/**
 *
 */
import OSS;
import OpenPlatform;
import OSSUtil;
import FileForm;
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @endpointRule = 'central';
  
  checkConfig(config);
  @endpoint = getEndpoint('cloudauth', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AIGCFaceVerifyRequest {
  faceContrastPicture?: string(name='FaceContrastPicture', example='/9j/4AAQSkZJRgABAQAASxxxxxxx'),
  faceContrastPictureUrl?: string(name='FaceContrastPictureUrl', example='https://cn-shanghai-aliyun-cloudauth-xxxxxx.oss-cn-shanghai.aliyuncs.com/verify/xxxxx/xxxxx.jpeg'),
  ossBucketName?: string(name='OssBucketName', example='cn-shanghai-aliyun-cloudauth-xxxxx'),
  ossObjectName?: string(name='OssObjectName', example='verify/xxxxx/xxxxxx.jpeg'),
  outerOrderNo?: string(name='OuterOrderNo', example='e0c34a77f5ac40a5aa5e6ed20c353888'),
  productCode?: string(name='ProductCode', example='LR_FR_AIGC'),
  sceneId?: long(name='SceneId', example='100000xxxx'),
}

model AIGCFaceVerifyResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  resultObject?: {
    certifyId?: string(name='CertifyId'),
    result?: string(name='Result', example='Y'),
    score?: string(name='Score', example='1.0000'),
  }(name='ResultObject'),
}

model AIGCFaceVerifyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AIGCFaceVerifyResponseBody(name='body'),
}

/**
 * @summary 新增AIGC人脸检测能力
 *
 * @param request AIGCFaceVerifyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AIGCFaceVerifyResponse
 */
async function aIGCFaceVerifyWithOptions(request: AIGCFaceVerifyRequest, runtime: $RuntimeOptions): AIGCFaceVerifyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.faceContrastPictureUrl)) {
    query['FaceContrastPictureUrl'] = request.faceContrastPictureUrl;
  }
  if (!$isNull(request.ossBucketName)) {
    query['OssBucketName'] = request.ossBucketName;
  }
  if (!$isNull(request.ossObjectName)) {
    query['OssObjectName'] = request.ossObjectName;
  }
  if (!$isNull(request.outerOrderNo)) {
    query['OuterOrderNo'] = request.outerOrderNo;
  }
  if (!$isNull(request.productCode)) {
    query['ProductCode'] = request.productCode;
  }
  if (!$isNull(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var body : map[string]any = {};
  if (!$isNull(request.faceContrastPicture)) {
    body['FaceContrastPicture'] = request.faceContrastPicture;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'AIGCFaceVerify',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 新增AIGC人脸检测能力
 *
 * @param request AIGCFaceVerifyRequest
 * @return AIGCFaceVerifyResponse
 */
async function aIGCFaceVerify(request: AIGCFaceVerifyRequest): AIGCFaceVerifyResponse {
  var runtime = new $RuntimeOptions{};
  return aIGCFaceVerifyWithOptions(request, runtime);
}

model BankMetaVerifyRequest {
  bankCard?: string(name='BankCard', example='610*************1181'),
  identifyNum?: string(name='IdentifyNum', example='429001********8211'),
  identityType?: string(name='IdentityType'),
  mobile?: string(name='Mobile', example='138******11'),
  paramType?: string(name='ParamType', example='normal'),
  productType?: string(name='ProductType', example='BANK_CARD_2_META'),
  userName?: string(name='UserName'),
  verifyMode?: string(name='VerifyMode', example='VERIFY_BANK_CARD'),
}

model BankMetaVerifyResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='473469C7-A***B-A3DC0DE3C83E'),
  resultObject?: {
    bizCode?: string(name='BizCode', example='1'),
    subCode?: string(name='SubCode', example='101'),
  }(name='ResultObject'),
}

model BankMetaVerifyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BankMetaVerifyResponseBody(name='body'),
}

/**
 * @summary 银行卡要素核验接口
 *
 * @param request BankMetaVerifyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BankMetaVerifyResponse
 */
async function bankMetaVerifyWithOptions(request: BankMetaVerifyRequest, runtime: $RuntimeOptions): BankMetaVerifyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.bankCard)) {
    query['BankCard'] = request.bankCard;
  }
  if (!$isNull(request.identifyNum)) {
    query['IdentifyNum'] = request.identifyNum;
  }
  if (!$isNull(request.identityType)) {
    query['IdentityType'] = request.identityType;
  }
  if (!$isNull(request.mobile)) {
    query['Mobile'] = request.mobile;
  }
  if (!$isNull(request.paramType)) {
    query['ParamType'] = request.paramType;
  }
  if (!$isNull(request.productType)) {
    query['ProductType'] = request.productType;
  }
  if (!$isNull(request.userName)) {
    query['UserName'] = request.userName;
  }
  if (!$isNull(request.verifyMode)) {
    query['VerifyMode'] = request.verifyMode;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'BankMetaVerify',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 银行卡要素核验接口
 *
 * @param request BankMetaVerifyRequest
 * @return BankMetaVerifyResponse
 */
async function bankMetaVerify(request: BankMetaVerifyRequest): BankMetaVerifyResponse {
  var runtime = new $RuntimeOptions{};
  return bankMetaVerifyWithOptions(request, runtime);
}

model CompareFaceVerifyRequest {
  crop?: string(name='Crop'),
  outerOrderNo?: string(name='OuterOrderNo', example='e0c34a77f5ac40a5aa5e6ed20c353888'),
  productCode?: string(name='ProductCode', example='PV_FC'),
  sceneId?: long(name='SceneId', example='1000000006'),
  sourceCertifyId?: string(name='SourceCertifyId', example='0bfa7c493f850e5178b9f8613634c9xx'),
  sourceFaceContrastPicture?: string(name='SourceFaceContrastPicture', example='/9j/4AAQSkZJRgABAQAASxxxxxxx'),
  sourceFaceContrastPictureUrl?: string(name='SourceFaceContrastPictureUrl', example='https://cn-shanghai-aliyun-cloudauth-xxxxxx.oss-cn-shanghai.aliyuncs.com/verify/xxxxx/xxxxx.jpeg'),
  sourceOssBucketName?: string(name='SourceOssBucketName', example='cn-shanghai-aliyun-cloudauth-xxxxx'),
  sourceOssObjectName?: string(name='SourceOssObjectName', example='verify/xxxxx/xxxxxx.jpeg'),
  targetCertifyId?: string(name='TargetCertifyId', example='0bfa7c493f850e5178b9f8613634c9xx'),
  targetFaceContrastPicture?: string(name='TargetFaceContrastPicture', example='/9j/4AAQSkZJRgABAQAASxxxxxxx'),
  targetFaceContrastPictureUrl?: string(name='TargetFaceContrastPictureUrl', example='https://cn-shanghai-aliyun-cloudauth-xxxxxx.oss-cn-shanghai.aliyuncs.com/verify/xxxxx/xxxxx.jpeg'),
  targetOssBucketName?: string(name='TargetOssBucketName', example='cn-shanghai-aliyun-cloudauth-xxxxx'),
  targetOssObjectName?: string(name='TargetOssObjectName', example='verify/xxxxx/xxxxxx.jpeg'),
}

model CompareFaceVerifyResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='130A2C10-B9EE-4D84-88E3-5384FF039795'),
  resultObject?: {
    certifyId?: string(name='CertifyId'),
    passed?: string(name='Passed', example='T'),
    verifyScore?: float(name='VerifyScore', example='99.60875'),
  }(name='ResultObject'),
}

model CompareFaceVerifyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CompareFaceVerifyResponseBody(name='body'),
}

/**
 * @param request CompareFaceVerifyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CompareFaceVerifyResponse
 */
async function compareFaceVerifyWithOptions(request: CompareFaceVerifyRequest, runtime: $RuntimeOptions): CompareFaceVerifyResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.crop)) {
    body['Crop'] = request.crop;
  }
  if (!$isNull(request.outerOrderNo)) {
    body['OuterOrderNo'] = request.outerOrderNo;
  }
  if (!$isNull(request.productCode)) {
    body['ProductCode'] = request.productCode;
  }
  if (!$isNull(request.sceneId)) {
    body['SceneId'] = request.sceneId;
  }
  if (!$isNull(request.sourceCertifyId)) {
    body['SourceCertifyId'] = request.sourceCertifyId;
  }
  if (!$isNull(request.sourceFaceContrastPicture)) {
    body['SourceFaceContrastPicture'] = request.sourceFaceContrastPicture;
  }
  if (!$isNull(request.sourceFaceContrastPictureUrl)) {
    body['SourceFaceContrastPictureUrl'] = request.sourceFaceContrastPictureUrl;
  }
  if (!$isNull(request.sourceOssBucketName)) {
    body['SourceOssBucketName'] = request.sourceOssBucketName;
  }
  if (!$isNull(request.sourceOssObjectName)) {
    body['SourceOssObjectName'] = request.sourceOssObjectName;
  }
  if (!$isNull(request.targetCertifyId)) {
    body['TargetCertifyId'] = request.targetCertifyId;
  }
  if (!$isNull(request.targetFaceContrastPicture)) {
    body['TargetFaceContrastPicture'] = request.targetFaceContrastPicture;
  }
  if (!$isNull(request.targetFaceContrastPictureUrl)) {
    body['TargetFaceContrastPictureUrl'] = request.targetFaceContrastPictureUrl;
  }
  if (!$isNull(request.targetOssBucketName)) {
    body['TargetOssBucketName'] = request.targetOssBucketName;
  }
  if (!$isNull(request.targetOssObjectName)) {
    body['TargetOssObjectName'] = request.targetOssObjectName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CompareFaceVerify',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request CompareFaceVerifyRequest
 * @return CompareFaceVerifyResponse
 */
async function compareFaceVerify(request: CompareFaceVerifyRequest): CompareFaceVerifyResponse {
  var runtime = new $RuntimeOptions{};
  return compareFaceVerifyWithOptions(request, runtime);
}

model CompareFacesRequest {
  sourceImageType?: string(name='SourceImageType', example='FacePic'),
  sourceImageValue?: string(name='SourceImageValue', example='http%3A%2F%2Fjiangsu.china.com.cn%2Fuploadfile%2F2015%2F0114%2F1421221304095989.jpg'),
  targetImageType?: string(name='TargetImageType', example='FacePic'),
  targetImageValue?: string(name='TargetImageValue', example='http%3A%2F%2Fjiangsu.china.com.cn%2Fuploadfile%2F2015%2F0114%2F1421221304095989.jpg'),
}

model CompareFacesResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    confidenceThresholds?: string(name='ConfidenceThresholds', example='{"0.0001":"90.07","0.001":"80.01","0.01":"70.02"}'),
    similarityScore?: float(name='SimilarityScore', example='98.7913'),
  }(name='Data'),
  message?: string(name='Message', example='Error.InternalError'),
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', example='true'),
}

model CompareFacesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CompareFacesResponseBody(name='body'),
}

/**
 * @param request CompareFacesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CompareFacesResponse
 */
async function compareFacesWithOptions(request: CompareFacesRequest, runtime: $RuntimeOptions): CompareFacesResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.sourceImageType)) {
    body['SourceImageType'] = request.sourceImageType;
  }
  if (!$isNull(request.sourceImageValue)) {
    body['SourceImageValue'] = request.sourceImageValue;
  }
  if (!$isNull(request.targetImageType)) {
    body['TargetImageType'] = request.targetImageType;
  }
  if (!$isNull(request.targetImageValue)) {
    body['TargetImageValue'] = request.targetImageValue;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CompareFaces',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request CompareFacesRequest
 * @return CompareFacesResponse
 */
async function compareFaces(request: CompareFacesRequest): CompareFacesResponse {
  var runtime = new $RuntimeOptions{};
  return compareFacesWithOptions(request, runtime);
}

model ContrastFaceVerifyRequest {
  certName?: string(name='CertName'),
  certNo?: string(name='CertNo', example='330103xxxxxxxxxxxx'),
  certType?: string(name='CertType', example='IDENTITY_CARD'),
  certifyId?: string(name='CertifyId', example='0bfa7c493f850e5178b9f8613634c9xx'),
  crop?: string(name='Crop'),
  deviceToken?: string(name='DeviceToken', example='McozS1ZWRcRZStlERcZZo_QOytx5jcgZoZJEoRLOxxxxxxx'),
  encryptType?: string(name='EncryptType'),
  faceContrastFile?: string(name='FaceContrastFile'),
  faceContrastPicture?: string(name='FaceContrastPicture', example='/9j/4AAQSkZJRgABAQAASxxxxxxx'),
  faceContrastPictureUrl?: string(name='FaceContrastPictureUrl', example='https://cn-shanghai-aliyun-cloudauth-xxxxxx.oss-cn-shanghai.aliyuncs.com/verify/xxxxx/xxxxx.jpeg'),
  ip?: string(name='Ip', example='114.xxx.xxx.xxx'),
  mobile?: string(name='Mobile', example='130xxxxxxxx'),
  model?: string(name='Model'),
  ossBucketName?: string(name='OssBucketName', example='cn-shanghai-aliyun-cloudauth-xxxxx'),
  ossObjectName?: string(name='OssObjectName', example='verify/xxxxx/xxxxxx.jpeg'),
  outerOrderNo?: string(name='OuterOrderNo', example='e0c34a77f5ac40a5aa5e6ed20c353888'),
  productCode?: string(name='ProductCode', example='ID_MIN'),
  sceneId?: long(name='SceneId', example='1000000006'),
  userId?: string(name='UserId', example='123456789'),
}

model ContrastFaceVerifyAdvanceRequest {
  certName?: string(name='CertName'),
  certNo?: string(name='CertNo', example='330103xxxxxxxxxxxx'),
  certType?: string(name='CertType', example='IDENTITY_CARD'),
  certifyId?: string(name='CertifyId', example='0bfa7c493f850e5178b9f8613634c9xx'),
  crop?: string(name='Crop'),
  deviceToken?: string(name='DeviceToken', example='McozS1ZWRcRZStlERcZZo_QOytx5jcgZoZJEoRLOxxxxxxx'),
  encryptType?: string(name='EncryptType'),
  faceContrastFileObject?: readable(name='FaceContrastFile'),
  faceContrastPicture?: string(name='FaceContrastPicture', example='/9j/4AAQSkZJRgABAQAASxxxxxxx'),
  faceContrastPictureUrl?: string(name='FaceContrastPictureUrl', example='https://cn-shanghai-aliyun-cloudauth-xxxxxx.oss-cn-shanghai.aliyuncs.com/verify/xxxxx/xxxxx.jpeg'),
  ip?: string(name='Ip', example='114.xxx.xxx.xxx'),
  mobile?: string(name='Mobile', example='130xxxxxxxx'),
  model?: string(name='Model'),
  ossBucketName?: string(name='OssBucketName', example='cn-shanghai-aliyun-cloudauth-xxxxx'),
  ossObjectName?: string(name='OssObjectName', example='verify/xxxxx/xxxxxx.jpeg'),
  outerOrderNo?: string(name='OuterOrderNo', example='e0c34a77f5ac40a5aa5e6ed20c353888'),
  productCode?: string(name='ProductCode', example='ID_MIN'),
  sceneId?: long(name='SceneId', example='1000000006'),
  userId?: string(name='UserId', example='123456789'),
}

model ContrastFaceVerifyResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='130A2C10-B9EE-4D84-88E3-5384FF039795'),
  resultObject?: {
    certifyId?: string(name='CertifyId'),
    identityInfo?: string(name='IdentityInfo', example='null'),
    materialInfo?: string(name='MaterialInfo', example='{"faceAttack": "F","facialPictureFront": {"qualityScore": 88.3615493774414,"verifyScore": 50.28594166529785}}'),
    passed?: string(name='Passed', example='T'),
    subCode?: string(name='SubCode', example='200'),
  }(name='ResultObject'),
}

model ContrastFaceVerifyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ContrastFaceVerifyResponseBody(name='body'),
}

/**
 * @param request ContrastFaceVerifyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ContrastFaceVerifyResponse
 */
async function contrastFaceVerifyWithOptions(request: ContrastFaceVerifyRequest, runtime: $RuntimeOptions): ContrastFaceVerifyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.model)) {
    query['Model'] = request.model;
  }
  var body : map[string]any = {};
  if (!$isNull(request.certName)) {
    body['CertName'] = request.certName;
  }
  if (!$isNull(request.certNo)) {
    body['CertNo'] = request.certNo;
  }
  if (!$isNull(request.certType)) {
    body['CertType'] = request.certType;
  }
  if (!$isNull(request.certifyId)) {
    body['CertifyId'] = request.certifyId;
  }
  if (!$isNull(request.crop)) {
    body['Crop'] = request.crop;
  }
  if (!$isNull(request.deviceToken)) {
    body['DeviceToken'] = request.deviceToken;
  }
  if (!$isNull(request.encryptType)) {
    body['EncryptType'] = request.encryptType;
  }
  if (!$isNull(request.faceContrastFile)) {
    body['FaceContrastFile'] = request.faceContrastFile;
  }
  if (!$isNull(request.faceContrastPicture)) {
    body['FaceContrastPicture'] = request.faceContrastPicture;
  }
  if (!$isNull(request.faceContrastPictureUrl)) {
    body['FaceContrastPictureUrl'] = request.faceContrastPictureUrl;
  }
  if (!$isNull(request.ip)) {
    body['Ip'] = request.ip;
  }
  if (!$isNull(request.mobile)) {
    body['Mobile'] = request.mobile;
  }
  if (!$isNull(request.ossBucketName)) {
    body['OssBucketName'] = request.ossBucketName;
  }
  if (!$isNull(request.ossObjectName)) {
    body['OssObjectName'] = request.ossObjectName;
  }
  if (!$isNull(request.outerOrderNo)) {
    body['OuterOrderNo'] = request.outerOrderNo;
  }
  if (!$isNull(request.productCode)) {
    body['ProductCode'] = request.productCode;
  }
  if (!$isNull(request.sceneId)) {
    body['SceneId'] = request.sceneId;
  }
  if (!$isNull(request.userId)) {
    body['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'ContrastFaceVerify',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ContrastFaceVerifyRequest
 * @return ContrastFaceVerifyResponse
 */
async function contrastFaceVerify(request: ContrastFaceVerifyRequest): ContrastFaceVerifyResponse {
  var runtime = new $RuntimeOptions{};
  return contrastFaceVerifyWithOptions(request, runtime);
}

async function contrastFaceVerifyAdvance(request: ContrastFaceVerifyAdvanceRequest, runtime: $RuntimeOptions): ContrastFaceVerifyResponse {
  // Step 0: init client
  var accessKeyId = @credential.getAccessKeyId();
  var accessKeySecret = @credential.getAccessKeySecret();
  var securityToken = @credential.getSecurityToken();
  var credentialType = @credential.getType();
  var openPlatformEndpoint = @openPlatformEndpoint;
  if($isNull(openPlatformEndpoint)) {
    openPlatformEndpoint ='openplatform.aliyuncs.com';
  }
  if($isNull(credentialType)) {
    credentialType ='access_key';
  }
  var authConfig = new OpenApiUtil.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    securityToken = securityToken,
    type = credentialType,
    endpoint = openPlatformEndpoint,
    protocol = @protocol,
    regionId = @regionId,
  };
  var authClient = new OpenPlatform(authConfig);
  var authRequest = new OpenPlatform.AuthorizeFileUploadRequest{
    product = 'Cloudauth',
    regionId = @regionId,
  };
  var authResponse = new OpenPlatform.AuthorizeFileUploadResponse{};
  var ossConfig = new OSS.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    type = 'access_key',
    protocol = @protocol,
    regionId = @regionId,
  };
  var ossClient : OSS = new OSS(ossConfig);

  var fileObj = new FileForm.FileField{};
  var ossHeader = new OSS.PostObjectRequest.header{};
  var uploadRequest = new OSS.PostObjectRequest{};
  var ossRuntime = new OSSUtil.RuntimeOptions{};
  OpenApiUtil.convert(runtime, ossRuntime);
  var contrastFaceVerifyReq = new ContrastFaceVerifyRequest{};
  OpenApiUtil.convert(request, contrastFaceVerifyReq);

  if(!$isNull(request.faceContrastFileObject)) {
    authResponse = authClient.authorizeFileUploadWithOptions(authRequest, runtime);
    ossConfig.accessKeyId = authResponse.body.accessKeyId;
    ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, @endpointType);
    ossClient = new OSS(ossConfig);

    fileObj = new FileForm.FileField{
      filename = authResponse.body.objectKey,
      content = request.faceContrastFileObject,
      contentType = '',
    };
    ossHeader = new OSS.PostObjectRequest.header{
      accessKeyId = authResponse.body.accessKeyId,
      policy = authResponse.body.encodedPolicy,
      signature = authResponse.body.signature,
      key = authResponse.body.objectKey,
      file = fileObj,
      successActionStatus = '201',
    };
    uploadRequest = new OSS.PostObjectRequest{
      bucketName = authResponse.body.bucket,
      header = ossHeader,
    };
    ossClient.postObject(uploadRequest, ossRuntime);
    contrastFaceVerifyReq.faceContrastFile = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
  }
  var contrastFaceVerifyResp = contrastFaceVerifyWithOptions(contrastFaceVerifyReq, runtime);
  return contrastFaceVerifyResp;
}

model CreateAuthKeyRequest {
  authYears?: int32(name='AuthYears', example='1'),
  bizType?: string(name='BizType', example='FACE_TEST'),
  test?: boolean(name='Test', example='false'),
  userDeviceId?: string(name='UserDeviceId', example='3iJ1AY$oHcu7mC69'),
}

model CreateAuthKeyResponseBody = {
  authKey?: string(name='AuthKey', example='auth.1KQMcnLd4m37LN2D0F0WCD-1qtQI$'),
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
}

model CreateAuthKeyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAuthKeyResponseBody(name='body'),
}

/**
 * @param request CreateAuthKeyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateAuthKeyResponse
 */
async function createAuthKeyWithOptions(request: CreateAuthKeyRequest, runtime: $RuntimeOptions): CreateAuthKeyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.authYears)) {
    query['AuthYears'] = request.authYears;
  }
  if (!$isNull(request.bizType)) {
    query['BizType'] = request.bizType;
  }
  if (!$isNull(request.test)) {
    query['Test'] = request.test;
  }
  if (!$isNull(request.userDeviceId)) {
    query['UserDeviceId'] = request.userDeviceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateAuthKey',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request CreateAuthKeyRequest
 * @return CreateAuthKeyResponse
 */
async function createAuthKey(request: CreateAuthKeyRequest): CreateAuthKeyResponse {
  var runtime = new $RuntimeOptions{};
  return createAuthKeyWithOptions(request, runtime);
}

model CreateVerifySettingRequest {
  bizName?: string(name='BizName', description='This parameter is required.'),
  bizType?: string(name='BizType', description='This parameter is required.', example='UserRegister'),
  guideStep?: boolean(name='GuideStep', example='false'),
  privacyStep?: boolean(name='PrivacyStep', example='true'),
  resultStep?: boolean(name='ResultStep', example='false'),
  solution?: string(name='Solution', description='This parameter is required.', example='RPBasic'),
}

model CreateVerifySettingResponseBody = {
  bizName?: string(name='BizName'),
  bizType?: string(name='BizType', example='UserRegister'),
  requestId?: string(name='RequestId', example='D6163397-15C5-419C-9ACC-B7C83E0B4C10'),
  solution?: string(name='Solution', example='RPBasic'),
  stepList?: [ string ](name='StepList'),
}

model CreateVerifySettingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateVerifySettingResponseBody(name='body'),
}

/**
 * @param request CreateVerifySettingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateVerifySettingResponse
 */
async function createVerifySettingWithOptions(request: CreateVerifySettingRequest, runtime: $RuntimeOptions): CreateVerifySettingResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.bizName)) {
    query['BizName'] = request.bizName;
  }
  if (!$isNull(request.bizType)) {
    query['BizType'] = request.bizType;
  }
  if (!$isNull(request.guideStep)) {
    query['GuideStep'] = request.guideStep;
  }
  if (!$isNull(request.privacyStep)) {
    query['PrivacyStep'] = request.privacyStep;
  }
  if (!$isNull(request.resultStep)) {
    query['ResultStep'] = request.resultStep;
  }
  if (!$isNull(request.solution)) {
    query['Solution'] = request.solution;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateVerifySetting',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request CreateVerifySettingRequest
 * @return CreateVerifySettingResponse
 */
async function createVerifySetting(request: CreateVerifySettingRequest): CreateVerifySettingResponse {
  var runtime = new $RuntimeOptions{};
  return createVerifySettingWithOptions(request, runtime);
}

model CredentialVerifyRequest {
  certNum?: string(name='CertNum', example='4601*****'),
  credName?: string(name='CredName', example='0104'),
  credType?: string(name='CredType', example='01'),
  identifyNum?: string(name='IdentifyNum', example='429001********8211'),
  imageContext?: string(name='ImageContext', example='base64'),
  imageUrl?: string(name='ImageUrl', example='http://marry.momocdn.com/avatar/3B/B6/3BB6527E-7467-926E-1048-B43614F20CC420230803_L.jpg'),
  isCheck?: string(name='IsCheck', example='0'),
  isOCR?: string(name='IsOCR', example='1'),
  merchantDetail?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='MerchantDetail'),
  merchantId?: string(name='MerchantId'),
  productCode?: string(name='ProductCode'),
  prompt?: string(name='Prompt'),
  promptModel?: string(name='PromptModel'),
  userName?: string(name='UserName'),
}

model CredentialVerifyShrinkRequest {
  certNum?: string(name='CertNum', example='4601*****'),
  credName?: string(name='CredName', example='0104'),
  credType?: string(name='CredType', example='01'),
  identifyNum?: string(name='IdentifyNum', example='429001********8211'),
  imageContext?: string(name='ImageContext', example='base64'),
  imageUrl?: string(name='ImageUrl', example='http://marry.momocdn.com/avatar/3B/B6/3BB6527E-7467-926E-1048-B43614F20CC420230803_L.jpg'),
  isCheck?: string(name='IsCheck', example='0'),
  isOCR?: string(name='IsOCR', example='1'),
  merchantDetailShrink?: string(name='MerchantDetail'),
  merchantId?: string(name='MerchantId'),
  productCode?: string(name='ProductCode'),
  prompt?: string(name='Prompt'),
  promptModel?: string(name='PromptModel'),
  userName?: string(name='UserName'),
}

model CredentialVerifyResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='D6163397-15C5-419C-9ACC-B7C83E0B4C10'),
  resultObject?: {
    materialInfo?: string(name='MaterialInfo'),
    ocrInfo?: string(name='OcrInfo'),
    result?: string(name='Result', example='1'),
    riskScore?: map[string]string(name='RiskScore'),
    riskTag?: string(name='RiskTag', example='PS,SCREEN_PHOTO'),
    verifyDetail?: string(name='VerifyDetail', example='**'),
    verifyResult?: string(name='VerifyResult', example='*'),
    vlResult?: {
      success?: boolean(name='Success'),
      vlContent?: string(name='VlContent'),
    }(name='VlResult'),
  }(name='ResultObject'),
}

model CredentialVerifyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CredentialVerifyResponseBody(name='body'),
}

/**
 * @summary 凭证核验
 *
 * @param tmpReq CredentialVerifyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CredentialVerifyResponse
 */
async function credentialVerifyWithOptions(tmpReq: CredentialVerifyRequest, runtime: $RuntimeOptions): CredentialVerifyResponse {
  tmpReq.validate();
  var request = new CredentialVerifyShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.merchantDetail)) {
    request.merchantDetailShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.merchantDetail, 'MerchantDetail', 'json');
  }
  var query = {};
  if (!$isNull(request.certNum)) {
    query['CertNum'] = request.certNum;
  }
  if (!$isNull(request.credName)) {
    query['CredName'] = request.credName;
  }
  if (!$isNull(request.credType)) {
    query['CredType'] = request.credType;
  }
  if (!$isNull(request.identifyNum)) {
    query['IdentifyNum'] = request.identifyNum;
  }
  if (!$isNull(request.imageUrl)) {
    query['ImageUrl'] = request.imageUrl;
  }
  if (!$isNull(request.isCheck)) {
    query['IsCheck'] = request.isCheck;
  }
  if (!$isNull(request.isOCR)) {
    query['IsOCR'] = request.isOCR;
  }
  if (!$isNull(request.merchantDetailShrink)) {
    query['MerchantDetail'] = request.merchantDetailShrink;
  }
  if (!$isNull(request.merchantId)) {
    query['MerchantId'] = request.merchantId;
  }
  if (!$isNull(request.productCode)) {
    query['ProductCode'] = request.productCode;
  }
  if (!$isNull(request.prompt)) {
    query['Prompt'] = request.prompt;
  }
  if (!$isNull(request.promptModel)) {
    query['PromptModel'] = request.promptModel;
  }
  if (!$isNull(request.userName)) {
    query['UserName'] = request.userName;
  }
  var body : map[string]any = {};
  if (!$isNull(request.imageContext)) {
    body['ImageContext'] = request.imageContext;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CredentialVerify',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 凭证核验
 *
 * @param request CredentialVerifyRequest
 * @return CredentialVerifyResponse
 */
async function credentialVerify(request: CredentialVerifyRequest): CredentialVerifyResponse {
  var runtime = new $RuntimeOptions{};
  return credentialVerifyWithOptions(request, runtime);
}

model CredentialVerifyV2Request {
  certNum?: string(name='CertNum', example='4601*****'),
  credName?: string(name='CredName', example='0104'),
  credType?: string(name='CredType', example='01'),
  identifyNum?: string(name='IdentifyNum', example='4****************1'),
  imageFile?: string(name='ImageFile'),
  imageUrl?: string(name='ImageUrl', example='http://marry.momocdn.com/avatar/3B/B6/3BB6527E-7467-926E-1048-B43614F20CC420230803_L.jpg'),
  isCheck?: string(name='IsCheck', example='0'),
  isOcr?: string(name='IsOcr', example='0'),
  merchantDetail?: [ 
    {
      key?: string(name='Key', example='MerchantName'),
      value?: string(name='Value', example='***'),
    }
  ](name='MerchantDetail'),
  merchantId?: string(name='MerchantId'),
  productCode?: string(name='ProductCode', example='ANTI_FAKE_CHECK'),
  prompt?: string(name='Prompt'),
  promptModel?: string(name='PromptModel', example='DEFAULT'),
  userName?: string(name='UserName'),
}

model CredentialVerifyV2AdvanceRequest {
  certNum?: string(name='CertNum', example='4601*****'),
  credName?: string(name='CredName', example='0104'),
  credType?: string(name='CredType', example='01'),
  identifyNum?: string(name='IdentifyNum', example='4****************1'),
  imageFileObject?: readable(name='ImageFile'),
  imageUrl?: string(name='ImageUrl', example='http://marry.momocdn.com/avatar/3B/B6/3BB6527E-7467-926E-1048-B43614F20CC420230803_L.jpg'),
  isCheck?: string(name='IsCheck', example='0'),
  isOcr?: string(name='IsOcr', example='0'),
  merchantDetail?: [ 
    {
      key?: string(name='Key', example='MerchantName'),
      value?: string(name='Value', example='***'),
    }
  ](name='MerchantDetail'),
  merchantId?: string(name='MerchantId'),
  productCode?: string(name='ProductCode', example='ANTI_FAKE_CHECK'),
  prompt?: string(name='Prompt'),
  promptModel?: string(name='PromptModel', example='DEFAULT'),
  userName?: string(name='UserName'),
}

model CredentialVerifyV2ShrinkRequest {
  certNum?: string(name='CertNum', example='4601*****'),
  credName?: string(name='CredName', example='0104'),
  credType?: string(name='CredType', example='01'),
  identifyNum?: string(name='IdentifyNum', example='4****************1'),
  imageFile?: string(name='ImageFile'),
  imageUrl?: string(name='ImageUrl', example='http://marry.momocdn.com/avatar/3B/B6/3BB6527E-7467-926E-1048-B43614F20CC420230803_L.jpg'),
  isCheck?: string(name='IsCheck', example='0'),
  isOcr?: string(name='IsOcr', example='0'),
  merchantDetailShrink?: string(name='MerchantDetail'),
  merchantId?: string(name='MerchantId'),
  productCode?: string(name='ProductCode', example='ANTI_FAKE_CHECK'),
  prompt?: string(name='Prompt'),
  promptModel?: string(name='PromptModel', example='DEFAULT'),
  userName?: string(name='UserName'),
}

model CredentialVerifyV2ResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  resultObject?: {
    materialInfo?: string(name='MaterialInfo'),
    ocrInfo?: string(name='OcrInfo'),
    result?: string(name='Result', example='1'),
    riskScore?: map[string]string(name='RiskScore'),
    riskTag?: string(name='RiskTag', example='PS,SCREEN_PHOTO'),
    verifyDetail?: string(name='VerifyDetail', example='**'),
    verifyResult?: string(name='VerifyResult', example='*'),
    vlResult?: {
      success?: boolean(name='Success', example='true'),
      vlContent?: string(name='VlContent'),
    }(name='VlResult'),
  }(name='ResultObject'),
}

model CredentialVerifyV2Response = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CredentialVerifyV2ResponseBody(name='body'),
}

/**
 * @summary 凭证核验
 *
 * @param tmpReq CredentialVerifyV2Request
 * @param runtime runtime options for this request RuntimeOptions
 * @return CredentialVerifyV2Response
 */
async function credentialVerifyV2WithOptions(tmpReq: CredentialVerifyV2Request, runtime: $RuntimeOptions): CredentialVerifyV2Response {
  tmpReq.validate();
  var request = new CredentialVerifyV2ShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.merchantDetail)) {
    request.merchantDetailShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.merchantDetail, 'MerchantDetail', 'json');
  }
  var query = {};
  if (!$isNull(request.certNum)) {
    query['CertNum'] = request.certNum;
  }
  if (!$isNull(request.credName)) {
    query['CredName'] = request.credName;
  }
  if (!$isNull(request.credType)) {
    query['CredType'] = request.credType;
  }
  if (!$isNull(request.identifyNum)) {
    query['IdentifyNum'] = request.identifyNum;
  }
  if (!$isNull(request.imageUrl)) {
    query['ImageUrl'] = request.imageUrl;
  }
  if (!$isNull(request.isCheck)) {
    query['IsCheck'] = request.isCheck;
  }
  if (!$isNull(request.isOcr)) {
    query['IsOcr'] = request.isOcr;
  }
  if (!$isNull(request.merchantDetailShrink)) {
    query['MerchantDetail'] = request.merchantDetailShrink;
  }
  if (!$isNull(request.merchantId)) {
    query['MerchantId'] = request.merchantId;
  }
  if (!$isNull(request.productCode)) {
    query['ProductCode'] = request.productCode;
  }
  if (!$isNull(request.prompt)) {
    query['Prompt'] = request.prompt;
  }
  if (!$isNull(request.promptModel)) {
    query['PromptModel'] = request.promptModel;
  }
  if (!$isNull(request.userName)) {
    query['UserName'] = request.userName;
  }
  var body : map[string]any = {};
  if (!$isNull(request.imageFile)) {
    body['ImageFile'] = request.imageFile;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'CredentialVerifyV2',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 凭证核验
 *
 * @param request CredentialVerifyV2Request
 * @return CredentialVerifyV2Response
 */
async function credentialVerifyV2(request: CredentialVerifyV2Request): CredentialVerifyV2Response {
  var runtime = new $RuntimeOptions{};
  return credentialVerifyV2WithOptions(request, runtime);
}

async function credentialVerifyV2Advance(request: CredentialVerifyV2AdvanceRequest, runtime: $RuntimeOptions): CredentialVerifyV2Response {
  // Step 0: init client
  var accessKeyId = @credential.getAccessKeyId();
  var accessKeySecret = @credential.getAccessKeySecret();
  var securityToken = @credential.getSecurityToken();
  var credentialType = @credential.getType();
  var openPlatformEndpoint = @openPlatformEndpoint;
  if($isNull(openPlatformEndpoint)) {
    openPlatformEndpoint ='openplatform.aliyuncs.com';
  }
  if($isNull(credentialType)) {
    credentialType ='access_key';
  }
  var authConfig = new OpenApiUtil.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    securityToken = securityToken,
    type = credentialType,
    endpoint = openPlatformEndpoint,
    protocol = @protocol,
    regionId = @regionId,
  };
  var authClient = new OpenPlatform(authConfig);
  var authRequest = new OpenPlatform.AuthorizeFileUploadRequest{
    product = 'Cloudauth',
    regionId = @regionId,
  };
  var authResponse = new OpenPlatform.AuthorizeFileUploadResponse{};
  var ossConfig = new OSS.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    type = 'access_key',
    protocol = @protocol,
    regionId = @regionId,
  };
  var ossClient : OSS = new OSS(ossConfig);

  var fileObj = new FileForm.FileField{};
  var ossHeader = new OSS.PostObjectRequest.header{};
  var uploadRequest = new OSS.PostObjectRequest{};
  var ossRuntime = new OSSUtil.RuntimeOptions{};
  OpenApiUtil.convert(runtime, ossRuntime);
  var credentialVerifyV2Req = new CredentialVerifyV2Request{};
  OpenApiUtil.convert(request, credentialVerifyV2Req);

  if(!$isNull(request.imageFileObject)) {
    authResponse = authClient.authorizeFileUploadWithOptions(authRequest, runtime);
    ossConfig.accessKeyId = authResponse.body.accessKeyId;
    ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, @endpointType);
    ossClient = new OSS(ossConfig);

    fileObj = new FileForm.FileField{
      filename = authResponse.body.objectKey,
      content = request.imageFileObject,
      contentType = '',
    };
    ossHeader = new OSS.PostObjectRequest.header{
      accessKeyId = authResponse.body.accessKeyId,
      policy = authResponse.body.encodedPolicy,
      signature = authResponse.body.signature,
      key = authResponse.body.objectKey,
      file = fileObj,
      successActionStatus = '201',
    };
    uploadRequest = new OSS.PostObjectRequest{
      bucketName = authResponse.body.bucket,
      header = ossHeader,
    };
    ossClient.postObject(uploadRequest, ossRuntime);
    credentialVerifyV2Req.imageFile = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
  }
  var credentialVerifyV2Resp = credentialVerifyV2WithOptions(credentialVerifyV2Req, runtime);
  return credentialVerifyV2Resp;
}

model DeepfakeDetectRequest {
  faceBase64?: string(name='FaceBase64', example='/9j/4AAQSkZJRgABAQAASxxxxxxx'),
  faceInputType?: string(name='FaceInputType', example='IMAGE'),
  faceUrl?: string(name='FaceUrl', example='https://cn-shanghai-aliyun-cloudauth-xxxxxx.oss-cn-shanghai.aliyuncs.com/verify/xxxxx/xxxxx.jpeg'),
  outerOrderNo?: string(name='OuterOrderNo', example='e0c34a77f5ac40a5aa5e6ed20c******'),
}

model DeepfakeDetectResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', description='Id of the request', example='8FC3D6AC-9FED-4311-8DA7-C4BF47D9F260'),
  resultObject?: {
    result?: string(name='Result', example='1'),
    riskScore?: map[string]string(name='RiskScore'),
    riskTag?: string(name='RiskTag', example='SuspectDeepForgery,SuspectWarterMark'),
  }(name='ResultObject'),
}

model DeepfakeDetectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeepfakeDetectResponseBody(name='body'),
}

/**
 * @summary 人脸凭证核验服务
 *
 * @param request DeepfakeDetectRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeepfakeDetectResponse
 */
async function deepfakeDetectWithOptions(request: DeepfakeDetectRequest, runtime: $RuntimeOptions): DeepfakeDetectResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.faceInputType)) {
    query['FaceInputType'] = request.faceInputType;
  }
  if (!$isNull(request.faceUrl)) {
    query['FaceUrl'] = request.faceUrl;
  }
  if (!$isNull(request.outerOrderNo)) {
    query['OuterOrderNo'] = request.outerOrderNo;
  }
  var body : map[string]any = {};
  if (!$isNull(request.faceBase64)) {
    body['FaceBase64'] = request.faceBase64;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeepfakeDetect',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 人脸凭证核验服务
 *
 * @param request DeepfakeDetectRequest
 * @return DeepfakeDetectResponse
 */
async function deepfakeDetect(request: DeepfakeDetectRequest): DeepfakeDetectResponse {
  var runtime = new $RuntimeOptions{};
  return deepfakeDetectWithOptions(request, runtime);
}

model DeleteFaceVerifyResultRequest {
  certifyId?: string(name='CertifyId', example='shae18209d29ce4e8ba252caae98ab15'),
  deleteAfterQuery?: string(name='DeleteAfterQuery', example='Y'),
}

model DeleteFaceVerifyResultResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', description='Id of the request', example='5A6229C0-E156-48E4-B6EC-0F528BDF60D2'),
  resultObject?: {
    certifyId?: string(name='CertifyId', example='sha58aeae7ea2f5ed069530f58df4e6d'),
    deleteResult?: string(name='DeleteResult', example='N'),
    failReason?: string(name='FailReason', example='NOT_DELETE_REPEATEDLY'),
  }(name='ResultObject'),
}

model DeleteFaceVerifyResultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteFaceVerifyResultResponseBody(name='body'),
}

/**
 * @summary 金融级服务敏感数据删除接口
 *
 * @param request DeleteFaceVerifyResultRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteFaceVerifyResultResponse
 */
async function deleteFaceVerifyResultWithOptions(request: DeleteFaceVerifyResultRequest, runtime: $RuntimeOptions): DeleteFaceVerifyResultResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certifyId)) {
    query['CertifyId'] = request.certifyId;
  }
  if (!$isNull(request.deleteAfterQuery)) {
    query['DeleteAfterQuery'] = request.deleteAfterQuery;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteFaceVerifyResult',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 金融级服务敏感数据删除接口
 *
 * @param request DeleteFaceVerifyResultRequest
 * @return DeleteFaceVerifyResultResponse
 */
async function deleteFaceVerifyResult(request: DeleteFaceVerifyResultRequest): DeleteFaceVerifyResultResponse {
  var runtime = new $RuntimeOptions{};
  return deleteFaceVerifyResultWithOptions(request, runtime);
}

model DescribeDeviceInfoRequest {
  bizType?: string(name='BizType', example='FACE_TEST'),
  currentPage?: int32(name='CurrentPage', example='1'),
  deviceId?: string(name='DeviceId', example='wd.6ziUffspAeW5FVYbaqmexR-1qwNjM'),
  expiredEndDay?: string(name='ExpiredEndDay', example='20200330'),
  expiredStartDay?: string(name='ExpiredStartDay', example='20190401'),
  pageSize?: int32(name='PageSize', example='20'),
  userDeviceId?: string(name='UserDeviceId', example='3iJ1AY$oHcu7mC69'),
}

model DescribeDeviceInfoResponseBody = {
  currentPage?: int32(name='CurrentPage', example='1'),
  deviceInfoList?: {
    deviceInfo?: [ 
    {
      beginDay?: string(name='BeginDay', example='20180101'),
      bizType?: string(name='BizType', example='FACE_TEST'),
      deviceId?: string(name='DeviceId', example='wd.6ziUffspAeW5FVYbaqmexR-1qwNjM'),
      expiredDay?: string(name='ExpiredDay', example='20180101'),
      userDeviceId?: string(name='UserDeviceId', example='3iJ1AY$oHcu7mC69'),
    }
  ](name='DeviceInfo')
  }(name='DeviceInfoList'),
  pageSize?: int32(name='PageSize', example='20'),
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  totalCount?: int32(name='TotalCount', example='1'),
}

model DescribeDeviceInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDeviceInfoResponseBody(name='body'),
}

/**
 * @param request DescribeDeviceInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeDeviceInfoResponse
 */
async function describeDeviceInfoWithOptions(request: DescribeDeviceInfoRequest, runtime: $RuntimeOptions): DescribeDeviceInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.bizType)) {
    query['BizType'] = request.bizType;
  }
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.expiredEndDay)) {
    query['ExpiredEndDay'] = request.expiredEndDay;
  }
  if (!$isNull(request.expiredStartDay)) {
    query['ExpiredStartDay'] = request.expiredStartDay;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.userDeviceId)) {
    query['UserDeviceId'] = request.userDeviceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeDeviceInfo',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeDeviceInfoRequest
 * @return DescribeDeviceInfoResponse
 */
async function describeDeviceInfo(request: DescribeDeviceInfoRequest): DescribeDeviceInfoResponse {
  var runtime = new $RuntimeOptions{};
  return describeDeviceInfoWithOptions(request, runtime);
}

model DescribeFaceGuardRiskRequest {
  bizId?: string(name='BizId', example='aba9830f471a4335af4612c8adaa91b0'),
  deviceToken?: string(name='DeviceToken', example='McozS1ZWRcRZStlERcZZo_QOytx5jcgZoZJEoRLOxxxxxxx'),
  outerOrderNo?: string(name='OuterOrderNo', example='e0c34a77f5ac40a5aa5e6ed20c35xxxx'),
  productCode?: string(name='ProductCode', example='FACE_GUARD'),
}

model DescribeFaceGuardRiskResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', description='Id of the request', example='D6163397-15C5-419C-9ACC-B7C83E0B4C10'),
  resultObject?: {
    certifyId?: string(name='CertifyId'),
    riskExtends?: string(name='RiskExtends', example='{
  "code": 200
  "badNet":false,
  "umid":"74e37355171ab62230063569350d368e",
  "fileTags":"basic_root,basic_hook",
  "queryCount":1,
  "querySessionCount":1,
  "queryUmidCount":1
  "platform":"Android"
}'),
    riskTags?: string(name='RiskTags'),
  }(name='ResultObject'),
}

model DescribeFaceGuardRiskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeFaceGuardRiskResponseBody(name='body'),
}

/**
 * @summary 金融级人脸保镖服务
 *
 * @param request DescribeFaceGuardRiskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeFaceGuardRiskResponse
 */
async function describeFaceGuardRiskWithOptions(request: DescribeFaceGuardRiskRequest, runtime: $RuntimeOptions): DescribeFaceGuardRiskResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!$isNull(request.deviceToken)) {
    query['DeviceToken'] = request.deviceToken;
  }
  if (!$isNull(request.outerOrderNo)) {
    query['OuterOrderNo'] = request.outerOrderNo;
  }
  if (!$isNull(request.productCode)) {
    query['ProductCode'] = request.productCode;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeFaceGuardRisk',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 金融级人脸保镖服务
 *
 * @param request DescribeFaceGuardRiskRequest
 * @return DescribeFaceGuardRiskResponse
 */
async function describeFaceGuardRisk(request: DescribeFaceGuardRiskRequest): DescribeFaceGuardRiskResponse {
  var runtime = new $RuntimeOptions{};
  return describeFaceGuardRiskWithOptions(request, runtime);
}

model DescribeFaceVerifyRequest {
  certifyId?: string(name='CertifyId', example='91707dc296d469ad38e4c5efa6a0f24b'),
  pictureReturnType?: string(name='PictureReturnType', example='JPG'),
  sceneId?: long(name='SceneId', example='1000000006'),
}

model DescribeFaceVerifyResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='130A2C10-B9EE-4D84-88E3-5384FF039795'),
  resultObject?: {
    deviceRisk?: string(name='DeviceRisk'),
    deviceToken?: string(name='DeviceToken', example='McozS1ZWRcRZStlERcZZo_QOytx5jcgZoZJEoRLOxxxxxxx'),
    identityInfo?: string(name='IdentityInfo', example='null'),
    materialInfo?: string(name='MaterialInfo', example='{"faceAttack": "F","facialPictureFront": {"qualityScore": 88.3615493774414,"pictureUrl": "https://cn-shanghai-aliyun-cloudauth-xxxxxx.oss-cn-shanghai.aliyuncs.com/verify/xxxxx/xxxxx.jpeg","ossBucketName": "cn-shanghai-aliyun-cloudauth-1260051251634779","ossObjectName": "verify/1260051251634779/6ba7bcfccf33f56cdb44ed086f36ce3e0.jpeg"}}'),
    passed?: string(name='Passed', example='T'),
    subCode?: string(name='SubCode', example='200'),
    success?: string(name='Success'),
    userInfo?: string(name='UserInfo'),
  }(name='ResultObject'),
}

model DescribeFaceVerifyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeFaceVerifyResponseBody(name='body'),
}

/**
 * @param request DescribeFaceVerifyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeFaceVerifyResponse
 */
async function describeFaceVerifyWithOptions(request: DescribeFaceVerifyRequest, runtime: $RuntimeOptions): DescribeFaceVerifyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certifyId)) {
    query['CertifyId'] = request.certifyId;
  }
  if (!$isNull(request.pictureReturnType)) {
    query['PictureReturnType'] = request.pictureReturnType;
  }
  if (!$isNull(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeFaceVerify',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeFaceVerifyRequest
 * @return DescribeFaceVerifyResponse
 */
async function describeFaceVerify(request: DescribeFaceVerifyRequest): DescribeFaceVerifyResponse {
  var runtime = new $RuntimeOptions{};
  return describeFaceVerifyWithOptions(request, runtime);
}

model DescribeOssUploadTokenResponseBody = {
  ossUploadToken?: {
    bucket?: string(name='Bucket', example='cloudauth-zhangjiakou-external'),
    endPoint?: string(name='EndPoint', example='https://oss-cn-zhangjiakou.aliyuncs.com'),
    expired?: long(name='Expired', example='1582636610000'),
    key?: string(name='Key', example='STS.NU8rUBj****'),
    path?: string(name='Path', example='prod/RdNLC@Ox2n-1s7NMt'),
    secret?: string(name='Secret', example='FwmnyoqT8dHj7nJLuM67T****'),
    token?: string(name='Token', example='uWia500nTS5knZaDzq4/KqpvhcLnO****'),
  }(name='OssUploadToken'),
  requestId?: string(name='RequestId', example='2FA2C773-47DB-4156-B1EE-5B047321A939'),
}

model DescribeOssUploadTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeOssUploadTokenResponseBody(name='body'),
}

/**
 * @param request DescribeOssUploadTokenRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeOssUploadTokenResponse
 */
async function describeOssUploadTokenWithOptions(runtime: $RuntimeOptions): DescribeOssUploadTokenResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'DescribeOssUploadToken',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @return DescribeOssUploadTokenResponse
 */
async function describeOssUploadToken(): DescribeOssUploadTokenResponse {
  var runtime = new $RuntimeOptions{};
  return describeOssUploadTokenWithOptions(runtime);
}

model DescribePageFaceVerifyDataRequest {
  currentPage?: long(name='CurrentPage', example='1'),
  endDate?: string(name='EndDate', example='2023-04-30'),
  pageSize?: long(name='PageSize', example='10'),
  productCode?: string(name='ProductCode', example='ID_PLUS'),
  sceneId?: long(name='SceneId', example='36**01'),
  startDate?: string(name='StartDate', example='2023-04-10'),
}

model DescribePageFaceVerifyDataResponseBody = {
  code?: string(name='Code', example='200'),
  currentPage?: string(name='CurrentPage', example='1'),
  items?: [ 
    {
      date?: string(name='Date', example='2024-03-24T00:00:00.000Z'),
      productCode?: string(name='ProductCode', example='ID_PLUS'),
      sceneId?: string(name='SceneId', example='20**40'),
      sceneName?: string(name='SceneName'),
      successCount?: string(name='SuccessCount', example='1'),
      totalCount?: string(name='TotalCount', example='19'),
    }
  ](name='Items'),
  message?: string(name='Message', example='OK'),
  pageSize?: string(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='473469C7-A***B-A3DC0DE3C83E'),
  success?: string(name='Success', example='true'),
  totalCount?: string(name='TotalCount', example='100'),
  totalPage?: string(name='TotalPage', example='5'),
}

model DescribePageFaceVerifyDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePageFaceVerifyDataResponseBody(name='body'),
}

/**
 * @summary Open API新增金融级数据统计API
 *
 * @param request DescribePageFaceVerifyDataRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePageFaceVerifyDataResponse
 */
async function describePageFaceVerifyDataWithOptions(request: DescribePageFaceVerifyDataRequest, runtime: $RuntimeOptions): DescribePageFaceVerifyDataResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.endDate)) {
    query['EndDate'] = request.endDate;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.productCode)) {
    query['ProductCode'] = request.productCode;
  }
  if (!$isNull(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  if (!$isNull(request.startDate)) {
    query['StartDate'] = request.startDate;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribePageFaceVerifyData',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Open API新增金融级数据统计API
 *
 * @param request DescribePageFaceVerifyDataRequest
 * @return DescribePageFaceVerifyDataResponse
 */
async function describePageFaceVerifyData(request: DescribePageFaceVerifyDataRequest): DescribePageFaceVerifyDataResponse {
  var runtime = new $RuntimeOptions{};
  return describePageFaceVerifyDataWithOptions(request, runtime);
}

model DescribeSmartStatisticsPageListRequest {
  currentPage?: string(name='CurrentPage', description='This parameter is required.', example='1'),
  endDate?: string(name='EndDate', description='This parameter is required.', example='2022-11-16 23:59:59 +0800'),
  pageSize?: string(name='PageSize', description='This parameter is required.', example='10'),
  sceneId?: string(name='SceneId', description='This parameter is required.', example='36**01'),
  serviceCode?: string(name='ServiceCode', example='cloudauthst'),
  startDate?: string(name='StartDate', description='This parameter is required.', example='2023-11-01 00:00:00 +0800'),
}

model DescribeSmartStatisticsPageListResponseBody = {
  currentPage?: int32(name='CurrentPage', example='1'),
  items?: [ 
    {
      date?: string(name='Date', example='11/8'),
      passRate?: string(name='PassRate', example='25'),
      productCode?: string(name='ProductCode', example='SMART_VERIFY'),
      sceneId?: long(name='SceneId', example='20**40'),
      sceneName?: string(name='SceneName'),
      successCount?: int32(name='SuccessCount', example='1'),
      totalCount?: int32(name='TotalCount', example='4'),
    }
  ](name='Items'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='96943***4E39F805'),
  totalCount?: int32(name='TotalCount', example='29'),
  totalPage?: int32(name='TotalPage', example='3'),
}

model DescribeSmartStatisticsPageListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSmartStatisticsPageListResponseBody(name='body'),
}

/**
 * @param request DescribeSmartStatisticsPageListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeSmartStatisticsPageListResponse
 */
async function describeSmartStatisticsPageListWithOptions(request: DescribeSmartStatisticsPageListRequest, runtime: $RuntimeOptions): DescribeSmartStatisticsPageListResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.endDate)) {
    query['EndDate'] = request.endDate;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  if (!$isNull(request.serviceCode)) {
    query['ServiceCode'] = request.serviceCode;
  }
  if (!$isNull(request.startDate)) {
    query['StartDate'] = request.startDate;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeSmartStatisticsPageList',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeSmartStatisticsPageListRequest
 * @return DescribeSmartStatisticsPageListResponse
 */
async function describeSmartStatisticsPageList(request: DescribeSmartStatisticsPageListRequest): DescribeSmartStatisticsPageListResponse {
  var runtime = new $RuntimeOptions{};
  return describeSmartStatisticsPageListWithOptions(request, runtime);
}

model DescribeVerifyResultRequest {
  bizId?: string(name='BizId', description='This parameter is required.', example='39ecf51e-2f81-4dc5-90ee-ff86125b****'),
  bizType?: string(name='BizType', description='This parameter is required.', example='FVBioOnlyTest'),
}

model DescribeVerifyResultResponseBody = {
  authorityComparisionScore?: float(name='AuthorityComparisionScore', example='97'),
  faceComparisonScore?: float(name='FaceComparisonScore', example='97'),
  idCardFaceComparisonScore?: float(name='IdCardFaceComparisonScore', example='97'),
  material?: {
    faceGlobalUrl?: string(name='FaceGlobalUrl', example='http://image-demo.img-cn-hangzhou.aliyuncs.com/face-global-example.jpg'),
    faceImageUrl?: string(name='FaceImageUrl', example='http://image-demo.img-cn-hangzhou.aliyuncs.com/face-image-example.jpg'),
    faceMask?: boolean(name='FaceMask', example='false'),
    faceQuality?: string(name='FaceQuality', example='NORMAL'),
    idCardInfo?: {
      address?: string(name='Address'),
      authority?: string(name='Authority'),
      backImageUrl?: string(name='BackImageUrl', example='http://image-demo.img-cn-hangzhou.aliyuncs.com/example3.jpg'),
      birth?: string(name='Birth', example='19900101'),
      endDate?: string(name='EndDate', example='20201101'),
      frontImageUrl?: string(name='FrontImageUrl', example='http://image-demo.img-cn-hangzhou.aliyuncs.com/example2.jpg'),
      name?: string(name='Name'),
      nationality?: string(name='Nationality'),
      number?: string(name='Number', example='02343218901123****'),
      startDate?: string(name='StartDate', example='20201101'),
    }(name='IdCardInfo'),
    idCardName?: string(name='IdCardName'),
    idCardNumber?: string(name='IdCardNumber', example='02343218901123****'),
    videoUrls?: [ string ](name='VideoUrls'),
  }(name='Material'),
  requestId?: string(name='RequestId', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  verifyStatus?: int32(name='VerifyStatus', example='1'),
}

model DescribeVerifyResultResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVerifyResultResponseBody(name='body'),
}

/**
 * @param request DescribeVerifyResultRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVerifyResultResponse
 */
async function describeVerifyResultWithOptions(request: DescribeVerifyResultRequest, runtime: $RuntimeOptions): DescribeVerifyResultResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!$isNull(request.bizType)) {
    query['BizType'] = request.bizType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVerifyResult',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeVerifyResultRequest
 * @return DescribeVerifyResultResponse
 */
async function describeVerifyResult(request: DescribeVerifyResultRequest): DescribeVerifyResultResponse {
  var runtime = new $RuntimeOptions{};
  return describeVerifyResultWithOptions(request, runtime);
}

model DescribeVerifySDKRequest {
  taskId?: string(name='TaskId', description='This parameter is required.', example='1KQMcnLd4m37LN2D0F0WCD'),
}

model DescribeVerifySDKResponseBody = {
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  sdkUrl?: string(name='SdkUrl', example='https://www.xxx.com'),
}

model DescribeVerifySDKResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVerifySDKResponseBody(name='body'),
}

/**
 * @param request DescribeVerifySDKRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVerifySDKResponse
 */
async function describeVerifySDKWithOptions(request: DescribeVerifySDKRequest, runtime: $RuntimeOptions): DescribeVerifySDKResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVerifySDK',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeVerifySDKRequest
 * @return DescribeVerifySDKResponse
 */
async function describeVerifySDK(request: DescribeVerifySDKRequest): DescribeVerifySDKResponse {
  var runtime = new $RuntimeOptions{};
  return describeVerifySDKWithOptions(request, runtime);
}

model DescribeVerifyTokenRequest {
  bizId?: string(name='BizId', description='This parameter is required.', example='39ecf51e-2f81-4dc5-90ee-ff86125be683'),
  bizType?: string(name='BizType', description='This parameter is required.', example='RPBasicTest'),
  callbackSeed?: string(name='CallbackSeed', example='-'),
  callbackUrl?: string(name='CallbackUrl', example='-'),
  faceRetainedImageUrl?: string(name='FaceRetainedImageUrl', example='http%3A%2F%2Fjiangsu.china.com.cn%2Fuploadfile%2F2015%2F0114%2F1421221304095989.jpg'),
  failedRedirectUrl?: string(name='FailedRedirectUrl', example='-'),
  idCardBackImageUrl?: string(name='IdCardBackImageUrl', example='http%3A%2F%2Fjiangsu.china.com.cn%2Fuploadfile%2F2015%2F0114%2F1421221304095989.jpg'),
  idCardFrontImageUrl?: string(name='IdCardFrontImageUrl', example='http%3A%2F%2Fjiangsu.china.com.cn%2Fuploadfile%2F2015%2F0114%2F1421221304095989.jpg'),
  idCardNumber?: string(name='IdCardNumber', example='330100xxxxxxxxxxxx'),
  name?: string(name='Name'),
  passedRedirectUrl?: string(name='PassedRedirectUrl', example='-'),
  userId?: string(name='UserId', example='user111'),
  userIp?: string(name='UserIp', example='192.168.***.***'),
  userPhoneNumber?: string(name='UserPhoneNumber', example='187********'),
  userRegistTime?: long(name='UserRegistTime', example='1577808000000'),
}

model DescribeVerifyTokenResponseBody = {
  ossUploadToken?: {
    bucket?: string(name='Bucket', example='cloudauth-zhangjiakou-external'),
    endPoint?: string(name='EndPoint', example='https://oss-cn-zhangjiakou.aliyuncs.com'),
    expired?: long(name='Expired', example='1582636610000'),
    key?: string(name='Key', example='STS.NU8rUBj****'),
    path?: string(name='Path', example='prod/RdNLC@Ox2n-1s7NMt'),
    secret?: string(name='Secret', example='FwmnyoqT8dHj7nJLuM67T****'),
    token?: string(name='Token', example='uWia500nTS5knZaDzq4/KqpvhcLnO****'),
  }(name='OssUploadToken'),
  requestId?: string(name='RequestId', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  verifyPageUrl?: string(name='VerifyPageUrl', example='http%3A%2F%2Fjiangsu.china.com.cn%2Fuploadfile%2F2015%2F0114%2F1421221304095989.jpg'),
  verifyToken?: string(name='VerifyToken', example='c302c0797679457685410ee51a5ba375'),
}

model DescribeVerifyTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeVerifyTokenResponseBody(name='body'),
}

/**
 * @param request DescribeVerifyTokenRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeVerifyTokenResponse
 */
async function describeVerifyTokenWithOptions(request: DescribeVerifyTokenRequest, runtime: $RuntimeOptions): DescribeVerifyTokenResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!$isNull(request.bizType)) {
    query['BizType'] = request.bizType;
  }
  if (!$isNull(request.callbackSeed)) {
    query['CallbackSeed'] = request.callbackSeed;
  }
  if (!$isNull(request.callbackUrl)) {
    query['CallbackUrl'] = request.callbackUrl;
  }
  if (!$isNull(request.faceRetainedImageUrl)) {
    query['FaceRetainedImageUrl'] = request.faceRetainedImageUrl;
  }
  if (!$isNull(request.failedRedirectUrl)) {
    query['FailedRedirectUrl'] = request.failedRedirectUrl;
  }
  if (!$isNull(request.idCardBackImageUrl)) {
    query['IdCardBackImageUrl'] = request.idCardBackImageUrl;
  }
  if (!$isNull(request.idCardFrontImageUrl)) {
    query['IdCardFrontImageUrl'] = request.idCardFrontImageUrl;
  }
  if (!$isNull(request.idCardNumber)) {
    query['IdCardNumber'] = request.idCardNumber;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.passedRedirectUrl)) {
    query['PassedRedirectUrl'] = request.passedRedirectUrl;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  if (!$isNull(request.userIp)) {
    query['UserIp'] = request.userIp;
  }
  if (!$isNull(request.userPhoneNumber)) {
    query['UserPhoneNumber'] = request.userPhoneNumber;
  }
  if (!$isNull(request.userRegistTime)) {
    query['UserRegistTime'] = request.userRegistTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DescribeVerifyToken',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeVerifyTokenRequest
 * @return DescribeVerifyTokenResponse
 */
async function describeVerifyToken(request: DescribeVerifyTokenRequest): DescribeVerifyTokenResponse {
  var runtime = new $RuntimeOptions{};
  return describeVerifyTokenWithOptions(request, runtime);
}

model DetectFaceAttributesRequest {
  bizType?: string(name='BizType', example='RPBasicTest'),
  materialValue?: string(name='MaterialValue', description='This parameter is required.', example='http://image-demo.img-cn-hangzhou.aliyuncs.com/example.jpg'),
}

model DetectFaceAttributesResponseBody = {
  code?: string(name='Code', example='200'),
  data?: {
    faceInfos?: {
      faceAttributesDetectInfo?: [ 
      {
        faceAttributes?: {
          blur?: float(name='Blur', example='0.1419367790222168'),
          facequal?: float(name='Facequal', example='60'),
          facetype?: string(name='Facetype', example='Face'),
          glasses?: string(name='Glasses', example='None'),
          headpose?: {
            pitchAngle?: float(name='PitchAngle', example='-1.5683923959732056'),
            rollAngle?: float(name='RollAngle', example='7.163370132446289'),
            yawAngle?: float(name='YawAngle', example='-6.925303936004639'),
          }(name='Headpose'),
          integrity?: int32(name='Integrity', example='70'),
          respirator?: string(name='Respirator', example='Wear'),
          smiling?: {
            threshold?: float(name='Threshold', example='95'),
            value?: float(name='Value', example='97'),
          }(name='Smiling'),
        }(name='FaceAttributes'),
        faceRect?: {
          height?: int32(name='Height', example='473'),
          left?: int32(name='Left', example='354'),
          top?: int32(name='Top', example='453'),
          width?: int32(name='Width', example='473'),
        }(name='FaceRect'),
      }
    ](name='FaceAttributesDetectInfo')
    }(name='FaceInfos'),
    imgHeight?: int32(name='ImgHeight', example='1920'),
    imgWidth?: int32(name='ImgWidth', example='1080'),
  }(name='Data'),
  message?: string(name='Message', example='Error.InternalError'),
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  success?: boolean(name='Success', example='true'),
}

model DetectFaceAttributesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DetectFaceAttributesResponseBody(name='body'),
}

/**
 * @param request DetectFaceAttributesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DetectFaceAttributesResponse
 */
async function detectFaceAttributesWithOptions(request: DetectFaceAttributesRequest, runtime: $RuntimeOptions): DetectFaceAttributesResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.bizType)) {
    body['BizType'] = request.bizType;
  }
  if (!$isNull(request.materialValue)) {
    body['MaterialValue'] = request.materialValue;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'DetectFaceAttributes',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DetectFaceAttributesRequest
 * @return DetectFaceAttributesResponse
 */
async function detectFaceAttributes(request: DetectFaceAttributesRequest): DetectFaceAttributesResponse {
  var runtime = new $RuntimeOptions{};
  return detectFaceAttributesWithOptions(request, runtime);
}

model Id2MetaPeriodVerifyRequest {
  identifyNum?: string(name='IdentifyNum', example='4****************1'),
  paramType?: string(name='ParamType', example='normal'),
  userName?: string(name='UserName'),
  validityEndDate?: string(name='ValidityEndDate', example='20301001'),
  validityStartDate?: string(name='ValidityStartDate', example='20201001'),
}

model Id2MetaPeriodVerifyResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', description='Id of the request', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  resultObject?: {
    bizCode?: string(name='BizCode', example='1'),
  }(name='ResultObject'),
}

model Id2MetaPeriodVerifyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: Id2MetaPeriodVerifyResponseBody(name='body'),
}

/**
 * @summary 二要素有效期核验接口
 *
 * @param request Id2MetaPeriodVerifyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return Id2MetaPeriodVerifyResponse
 */
async function id2MetaPeriodVerifyWithOptions(request: Id2MetaPeriodVerifyRequest, runtime: $RuntimeOptions): Id2MetaPeriodVerifyResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.identifyNum)) {
    body['IdentifyNum'] = request.identifyNum;
  }
  if (!$isNull(request.paramType)) {
    body['ParamType'] = request.paramType;
  }
  if (!$isNull(request.userName)) {
    body['UserName'] = request.userName;
  }
  if (!$isNull(request.validityEndDate)) {
    body['ValidityEndDate'] = request.validityEndDate;
  }
  if (!$isNull(request.validityStartDate)) {
    body['ValidityStartDate'] = request.validityStartDate;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'Id2MetaPeriodVerify',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 二要素有效期核验接口
 *
 * @param request Id2MetaPeriodVerifyRequest
 * @return Id2MetaPeriodVerifyResponse
 */
async function id2MetaPeriodVerify(request: Id2MetaPeriodVerifyRequest): Id2MetaPeriodVerifyResponse {
  var runtime = new $RuntimeOptions{};
  return id2MetaPeriodVerifyWithOptions(request, runtime);
}

model Id2MetaStandardVerifyRequest {
  identifyNum?: string(name='IdentifyNum', example='4****************1'),
  paramType?: string(name='ParamType', example='normal'),
  userName?: string(name='UserName'),
}

model Id2MetaStandardVerifyResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', description='Id of the request', example='D6163397-15C5-419C-9ACC-B7C83E0B4C10'),
  resultObject?: {
    bizCode?: string(name='BizCode', example='1'),
  }(name='ResultObject'),
}

model Id2MetaStandardVerifyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: Id2MetaStandardVerifyResponseBody(name='body'),
}

/**
 * @summary 身份二要素标准版
 *
 * @param request Id2MetaStandardVerifyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return Id2MetaStandardVerifyResponse
 */
async function id2MetaStandardVerifyWithOptions(request: Id2MetaStandardVerifyRequest, runtime: $RuntimeOptions): Id2MetaStandardVerifyResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.identifyNum)) {
    body['IdentifyNum'] = request.identifyNum;
  }
  if (!$isNull(request.paramType)) {
    body['ParamType'] = request.paramType;
  }
  if (!$isNull(request.userName)) {
    body['UserName'] = request.userName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'Id2MetaStandardVerify',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 身份二要素标准版
 *
 * @param request Id2MetaStandardVerifyRequest
 * @return Id2MetaStandardVerifyResponse
 */
async function id2MetaStandardVerify(request: Id2MetaStandardVerifyRequest): Id2MetaStandardVerifyResponse {
  var runtime = new $RuntimeOptions{};
  return id2MetaStandardVerifyWithOptions(request, runtime);
}

model Id2MetaVerifyRequest {
  identifyNum?: string(name='IdentifyNum'),
  paramType?: string(name='ParamType'),
  userName?: string(name='UserName'),
}

model Id2MetaVerifyResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='D6163397-15C5-419C-9ACC-B7C83E0B4C10'),
  resultObject?: {
    bizCode?: string(name='BizCode', example='1'),
  }(name='ResultObject'),
}

model Id2MetaVerifyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: Id2MetaVerifyResponseBody(name='body'),
}

/**
 * @summary 身份二要素接口
 *
 * @param request Id2MetaVerifyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return Id2MetaVerifyResponse
 */
async function id2MetaVerifyWithOptions(request: Id2MetaVerifyRequest, runtime: $RuntimeOptions): Id2MetaVerifyResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.identifyNum)) {
    body['IdentifyNum'] = request.identifyNum;
  }
  if (!$isNull(request.paramType)) {
    body['ParamType'] = request.paramType;
  }
  if (!$isNull(request.userName)) {
    body['UserName'] = request.userName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'Id2MetaVerify',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 身份二要素接口
 *
 * @param request Id2MetaVerifyRequest
 * @return Id2MetaVerifyResponse
 */
async function id2MetaVerify(request: Id2MetaVerifyRequest): Id2MetaVerifyResponse {
  var runtime = new $RuntimeOptions{};
  return id2MetaVerifyWithOptions(request, runtime);
}

model Id2MetaVerifyWithOCRRequest {
  certFile?: string(name='CertFile'),
  certNationalFile?: string(name='CertNationalFile'),
  certNationalUrl?: string(name='CertNationalUrl', example='https://www.aliyun.com/cert.jpeg'),
  certUrl?: string(name='CertUrl', example='https://www.aliyun.com/cert.jpeg'),
}

model Id2MetaVerifyWithOCRAdvanceRequest {
  certFileObject?: readable(name='CertFile'),
  certNationalFileObject?: readable(name='CertNationalFile'),
  certNationalUrl?: string(name='CertNationalUrl', example='https://www.aliyun.com/cert.jpeg'),
  certUrl?: string(name='CertUrl', example='https://www.aliyun.com/cert.jpeg'),
}

model Id2MetaVerifyWithOCRResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='130A2C10-B9EE-4D84-88E3-5384FF03****'),
  resultObject?: {
    bizCode?: string(name='BizCode', example='1'),
    cardInfo?: string(name='CardInfo'),
  }(name='ResultObject'),
}

model Id2MetaVerifyWithOCRResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: Id2MetaVerifyWithOCRResponseBody(name='body'),
}

/**
 * @summary 身份二要素图片核验
 *
 * @param request Id2MetaVerifyWithOCRRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return Id2MetaVerifyWithOCRResponse
 */
async function id2MetaVerifyWithOCRWithOptions(request: Id2MetaVerifyWithOCRRequest, runtime: $RuntimeOptions): Id2MetaVerifyWithOCRResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.certFile)) {
    body['CertFile'] = request.certFile;
  }
  if (!$isNull(request.certNationalFile)) {
    body['CertNationalFile'] = request.certNationalFile;
  }
  if (!$isNull(request.certNationalUrl)) {
    body['CertNationalUrl'] = request.certNationalUrl;
  }
  if (!$isNull(request.certUrl)) {
    body['CertUrl'] = request.certUrl;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'Id2MetaVerifyWithOCR',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 身份二要素图片核验
 *
 * @param request Id2MetaVerifyWithOCRRequest
 * @return Id2MetaVerifyWithOCRResponse
 */
async function id2MetaVerifyWithOCR(request: Id2MetaVerifyWithOCRRequest): Id2MetaVerifyWithOCRResponse {
  var runtime = new $RuntimeOptions{};
  return id2MetaVerifyWithOCRWithOptions(request, runtime);
}

async function id2MetaVerifyWithOCRAdvance(request: Id2MetaVerifyWithOCRAdvanceRequest, runtime: $RuntimeOptions): Id2MetaVerifyWithOCRResponse {
  // Step 0: init client
  var accessKeyId = @credential.getAccessKeyId();
  var accessKeySecret = @credential.getAccessKeySecret();
  var securityToken = @credential.getSecurityToken();
  var credentialType = @credential.getType();
  var openPlatformEndpoint = @openPlatformEndpoint;
  if($isNull(openPlatformEndpoint)) {
    openPlatformEndpoint ='openplatform.aliyuncs.com';
  }
  if($isNull(credentialType)) {
    credentialType ='access_key';
  }
  var authConfig = new OpenApiUtil.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    securityToken = securityToken,
    type = credentialType,
    endpoint = openPlatformEndpoint,
    protocol = @protocol,
    regionId = @regionId,
  };
  var authClient = new OpenPlatform(authConfig);
  var authRequest = new OpenPlatform.AuthorizeFileUploadRequest{
    product = 'Cloudauth',
    regionId = @regionId,
  };
  var authResponse = new OpenPlatform.AuthorizeFileUploadResponse{};
  var ossConfig = new OSS.Config{
    accessKeyId = accessKeyId,
    accessKeySecret = accessKeySecret,
    type = 'access_key',
    protocol = @protocol,
    regionId = @regionId,
  };
  var ossClient : OSS = new OSS(ossConfig);

  var fileObj = new FileForm.FileField{};
  var ossHeader = new OSS.PostObjectRequest.header{};
  var uploadRequest = new OSS.PostObjectRequest{};
  var ossRuntime = new OSSUtil.RuntimeOptions{};
  OpenApiUtil.convert(runtime, ossRuntime);
  var id2MetaVerifyWithOCRReq = new Id2MetaVerifyWithOCRRequest{};
  OpenApiUtil.convert(request, id2MetaVerifyWithOCRReq);

  if(!$isNull(request.certFileObject)) {
    authResponse = authClient.authorizeFileUploadWithOptions(authRequest, runtime);
    ossConfig.accessKeyId = authResponse.body.accessKeyId;
    ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, @endpointType);
    ossClient = new OSS(ossConfig);

    fileObj = new FileForm.FileField{
      filename = authResponse.body.objectKey,
      content = request.certFileObject,
      contentType = '',
    };
    ossHeader = new OSS.PostObjectRequest.header{
      accessKeyId = authResponse.body.accessKeyId,
      policy = authResponse.body.encodedPolicy,
      signature = authResponse.body.signature,
      key = authResponse.body.objectKey,
      file = fileObj,
      successActionStatus = '201',
    };
    uploadRequest = new OSS.PostObjectRequest{
      bucketName = authResponse.body.bucket,
      header = ossHeader,
    };
    ossClient.postObject(uploadRequest, ossRuntime);
    id2MetaVerifyWithOCRReq.certFile = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
  }
  if(!$isNull(request.certNationalFileObject)) {
    authResponse = authClient.authorizeFileUploadWithOptions(authRequest, runtime);
    ossConfig.accessKeyId = authResponse.body.accessKeyId;
    ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, @endpointType);
    ossClient = new OSS(ossConfig);

    fileObj = new FileForm.FileField{
      filename = authResponse.body.objectKey,
      content = request.certNationalFileObject,
      contentType = '',
    };
    ossHeader = new OSS.PostObjectRequest.header{
      accessKeyId = authResponse.body.accessKeyId,
      policy = authResponse.body.encodedPolicy,
      signature = authResponse.body.signature,
      key = authResponse.body.objectKey,
      file = fileObj,
      successActionStatus = '201',
    };
    uploadRequest = new OSS.PostObjectRequest{
      bucketName = authResponse.body.bucket,
      header = ossHeader,
    };
    ossClient.postObject(uploadRequest, ossRuntime);
    id2MetaVerifyWithOCRReq.certNationalFile = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
  }
  var id2MetaVerifyWithOCRResp = id2MetaVerifyWithOCRWithOptions(id2MetaVerifyWithOCRReq, runtime);
  return id2MetaVerifyWithOCRResp;
}

model InitFaceVerifyRequest {
  appQualityCheck?: string(name='AppQualityCheck'),
  authId?: string(name='AuthId'),
  birthday?: string(name='Birthday'),
  callbackToken?: string(name='CallbackToken'),
  callbackUrl?: string(name='CallbackUrl'),
  cameraSelection?: string(name='CameraSelection'),
  certName?: string(name='CertName'),
  certNo?: string(name='CertNo', example='330103xxxxxxxxxxxx'),
  certType?: string(name='CertType', example='IDENTITY_CARD'),
  certifyId?: string(name='CertifyId', example='0bfa7c493f850e5178b9f8613634c9xx'),
  certifyUrlStyle?: string(name='CertifyUrlStyle'),
  certifyUrlType?: string(name='CertifyUrlType'),
  crop?: string(name='Crop'),
  encryptType?: string(name='EncryptType'),
  faceContrastPicture?: string(name='FaceContrastPicture', example='/9j/4AAQSkZJRgABAQAASxxxxxxx'),
  faceContrastPictureUrl?: string(name='FaceContrastPictureUrl', example='https://cn-shanghai-aliyun-cloudauth-xxxxxx.oss-cn-shanghai.aliyuncs.com/verify/xxxxx/xxxxx.jpeg'),
  faceGuardOutput?: string(name='FaceGuardOutput'),
  ip?: string(name='Ip', example='114.xxx.xxx.xxx'),
  metaInfo?: string(name='MetaInfo', example='{"zimVer":"3.0.0","appVersion": "1","bioMetaInfo": "4.1.0:11501568,0","appName": "com.aliyun.antcloudauth","deviceType": "ios","osVersion": "iOS 10.3.2","apdidToken": "","deviceModel": "iPhone9,1"}'),
  mobile?: string(name='Mobile', example='130xxxxxxxx'),
  mode?: string(name='Mode'),
  model?: string(name='Model'),
  ossBucketName?: string(name='OssBucketName', example='cn-shanghai-aliyun-cloudauth-xxxxx'),
  ossObjectName?: string(name='OssObjectName', example='verify/xxxxx/xxxxxx.jpeg'),
  outerOrderNo?: string(name='OuterOrderNo', example='e0c34a77f5ac40a5aa5e6ed20c353888'),
  procedurePriority?: string(name='ProcedurePriority'),
  productCode?: string(name='ProductCode', example='ID_PRO'),
  rarelyCharacters?: string(name='RarelyCharacters'),
  readImg?: string(name='ReadImg'),
  returnUrl?: string(name='ReturnUrl', example='www.aliyun.com'),
  sceneId?: long(name='SceneId', example='1000000006'),
  suitableType?: string(name='SuitableType'),
  uiCustomUrl?: string(name='UiCustomUrl'),
  userId?: string(name='UserId', example='123456789'),
  validityDate?: string(name='ValidityDate'),
  videoEvidence?: string(name='VideoEvidence'),
  voluntaryCustomizedContent?: string(name='VoluntaryCustomizedContent'),
}

model InitFaceVerifyResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='130A2C10-B9EE-4D84-88E3-5384FF039795'),
  resultObject?: {
    certifyId?: string(name='CertifyId', example='91707dc296d469ad38e4c5efa6a0f24b'),
    certifyUrl?: string(name='CertifyUrl'),
  }(name='ResultObject'),
}

model InitFaceVerifyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: InitFaceVerifyResponseBody(name='body'),
}

/**
 * @param request InitFaceVerifyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return InitFaceVerifyResponse
 */
async function initFaceVerifyWithOptions(request: InitFaceVerifyRequest, runtime: $RuntimeOptions): InitFaceVerifyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.appQualityCheck)) {
    query['AppQualityCheck'] = request.appQualityCheck;
  }
  if (!$isNull(request.birthday)) {
    query['Birthday'] = request.birthday;
  }
  if (!$isNull(request.callbackToken)) {
    query['CallbackToken'] = request.callbackToken;
  }
  if (!$isNull(request.callbackUrl)) {
    query['CallbackUrl'] = request.callbackUrl;
  }
  if (!$isNull(request.cameraSelection)) {
    query['CameraSelection'] = request.cameraSelection;
  }
  if (!$isNull(request.certName)) {
    query['CertName'] = request.certName;
  }
  if (!$isNull(request.certNo)) {
    query['CertNo'] = request.certNo;
  }
  if (!$isNull(request.certType)) {
    query['CertType'] = request.certType;
  }
  if (!$isNull(request.certifyId)) {
    query['CertifyId'] = request.certifyId;
  }
  if (!$isNull(request.certifyUrlStyle)) {
    query['CertifyUrlStyle'] = request.certifyUrlStyle;
  }
  if (!$isNull(request.certifyUrlType)) {
    query['CertifyUrlType'] = request.certifyUrlType;
  }
  if (!$isNull(request.encryptType)) {
    query['EncryptType'] = request.encryptType;
  }
  if (!$isNull(request.faceContrastPictureUrl)) {
    query['FaceContrastPictureUrl'] = request.faceContrastPictureUrl;
  }
  if (!$isNull(request.faceGuardOutput)) {
    query['FaceGuardOutput'] = request.faceGuardOutput;
  }
  if (!$isNull(request.ip)) {
    query['Ip'] = request.ip;
  }
  if (!$isNull(request.metaInfo)) {
    query['MetaInfo'] = request.metaInfo;
  }
  if (!$isNull(request.mobile)) {
    query['Mobile'] = request.mobile;
  }
  if (!$isNull(request.mode)) {
    query['Mode'] = request.mode;
  }
  if (!$isNull(request.ossBucketName)) {
    query['OssBucketName'] = request.ossBucketName;
  }
  if (!$isNull(request.ossObjectName)) {
    query['OssObjectName'] = request.ossObjectName;
  }
  if (!$isNull(request.outerOrderNo)) {
    query['OuterOrderNo'] = request.outerOrderNo;
  }
  if (!$isNull(request.procedurePriority)) {
    query['ProcedurePriority'] = request.procedurePriority;
  }
  if (!$isNull(request.productCode)) {
    query['ProductCode'] = request.productCode;
  }
  if (!$isNull(request.rarelyCharacters)) {
    query['RarelyCharacters'] = request.rarelyCharacters;
  }
  if (!$isNull(request.readImg)) {
    query['ReadImg'] = request.readImg;
  }
  if (!$isNull(request.returnUrl)) {
    query['ReturnUrl'] = request.returnUrl;
  }
  if (!$isNull(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  if (!$isNull(request.suitableType)) {
    query['SuitableType'] = request.suitableType;
  }
  if (!$isNull(request.uiCustomUrl)) {
    query['UiCustomUrl'] = request.uiCustomUrl;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  if (!$isNull(request.validityDate)) {
    query['ValidityDate'] = request.validityDate;
  }
  if (!$isNull(request.videoEvidence)) {
    query['VideoEvidence'] = request.videoEvidence;
  }
  if (!$isNull(request.voluntaryCustomizedContent)) {
    query['VoluntaryCustomizedContent'] = request.voluntaryCustomizedContent;
  }
  var body : map[string]any = {};
  if (!$isNull(request.authId)) {
    body['AuthId'] = request.authId;
  }
  if (!$isNull(request.crop)) {
    body['Crop'] = request.crop;
  }
  if (!$isNull(request.faceContrastPicture)) {
    body['FaceContrastPicture'] = request.faceContrastPicture;
  }
  if (!$isNull(request.model)) {
    body['Model'] = request.model;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'InitFaceVerify',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request InitFaceVerifyRequest
 * @return InitFaceVerifyResponse
 */
async function initFaceVerify(request: InitFaceVerifyRequest): InitFaceVerifyResponse {
  var runtime = new $RuntimeOptions{};
  return initFaceVerifyWithOptions(request, runtime);
}

model InsertWhiteListSettingRequest {
  certNo?: string(name='CertNo', example='330103xxxxxxxxxxxx'),
  certifyId?: string(name='CertifyId', example='shsf57a4e0d9981c3bd66dc754f3d3cd'),
  remark?: string(name='Remark', example='xxxxxx'),
  sceneId?: long(name='SceneId', example='100000xxxx'),
  serviceCode?: string(name='ServiceCode', example='antcloudauth'),
  validDay?: int32(name='ValidDay', example='30'),
}

model InsertWhiteListSettingResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', description='Id of the request', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  resultObject?: boolean(name='ResultObject', example='true'),
  success?: boolean(name='Success', example='true'),
}

model InsertWhiteListSettingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: InsertWhiteListSettingResponseBody(name='body'),
}

/**
 * @summary 新增实人白名单
 *
 * @param request InsertWhiteListSettingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return InsertWhiteListSettingResponse
 */
async function insertWhiteListSettingWithOptions(request: InsertWhiteListSettingRequest, runtime: $RuntimeOptions): InsertWhiteListSettingResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certNo)) {
    query['CertNo'] = request.certNo;
  }
  if (!$isNull(request.certifyId)) {
    query['CertifyId'] = request.certifyId;
  }
  if (!$isNull(request.remark)) {
    query['Remark'] = request.remark;
  }
  if (!$isNull(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  if (!$isNull(request.serviceCode)) {
    query['ServiceCode'] = request.serviceCode;
  }
  if (!$isNull(request.validDay)) {
    query['ValidDay'] = request.validDay;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'InsertWhiteListSetting',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 新增实人白名单
 *
 * @param request InsertWhiteListSettingRequest
 * @return InsertWhiteListSettingResponse
 */
async function insertWhiteListSetting(request: InsertWhiteListSettingRequest): InsertWhiteListSettingResponse {
  var runtime = new $RuntimeOptions{};
  return insertWhiteListSettingWithOptions(request, runtime);
}

model LivenessFaceVerifyRequest {
  certifyId?: string(name='CertifyId'),
  crop?: string(name='Crop'),
  deviceToken?: string(name='DeviceToken'),
  faceContrastPicture?: string(name='FaceContrastPicture'),
  faceContrastPictureUrl?: string(name='FaceContrastPictureUrl'),
  ip?: string(name='Ip'),
  mobile?: string(name='Mobile'),
  model?: string(name='Model'),
  ossBucketName?: string(name='OssBucketName'),
  ossObjectName?: string(name='OssObjectName'),
  outerOrderNo?: string(name='OuterOrderNo'),
  productCode?: string(name='ProductCode'),
  sceneId?: long(name='SceneId'),
  userId?: string(name='UserId'),
}

model LivenessFaceVerifyResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  resultObject?: {
    certifyId?: string(name='CertifyId'),
    materialInfo?: string(name='MaterialInfo'),
    passed?: string(name='Passed'),
    subCode?: string(name='SubCode'),
  }(name='ResultObject'),
}

model LivenessFaceVerifyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LivenessFaceVerifyResponseBody(name='body'),
}

/**
 * @param request LivenessFaceVerifyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return LivenessFaceVerifyResponse
 */
async function livenessFaceVerifyWithOptions(request: LivenessFaceVerifyRequest, runtime: $RuntimeOptions): LivenessFaceVerifyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.model)) {
    query['Model'] = request.model;
  }
  var body : map[string]any = {};
  if (!$isNull(request.certifyId)) {
    body['CertifyId'] = request.certifyId;
  }
  if (!$isNull(request.crop)) {
    body['Crop'] = request.crop;
  }
  if (!$isNull(request.deviceToken)) {
    body['DeviceToken'] = request.deviceToken;
  }
  if (!$isNull(request.faceContrastPicture)) {
    body['FaceContrastPicture'] = request.faceContrastPicture;
  }
  if (!$isNull(request.faceContrastPictureUrl)) {
    body['FaceContrastPictureUrl'] = request.faceContrastPictureUrl;
  }
  if (!$isNull(request.ip)) {
    body['Ip'] = request.ip;
  }
  if (!$isNull(request.mobile)) {
    body['Mobile'] = request.mobile;
  }
  if (!$isNull(request.ossBucketName)) {
    body['OssBucketName'] = request.ossBucketName;
  }
  if (!$isNull(request.ossObjectName)) {
    body['OssObjectName'] = request.ossObjectName;
  }
  if (!$isNull(request.outerOrderNo)) {
    body['OuterOrderNo'] = request.outerOrderNo;
  }
  if (!$isNull(request.productCode)) {
    body['ProductCode'] = request.productCode;
  }
  if (!$isNull(request.sceneId)) {
    body['SceneId'] = request.sceneId;
  }
  if (!$isNull(request.userId)) {
    body['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'LivenessFaceVerify',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request LivenessFaceVerifyRequest
 * @return LivenessFaceVerifyResponse
 */
async function livenessFaceVerify(request: LivenessFaceVerifyRequest): LivenessFaceVerifyResponse {
  var runtime = new $RuntimeOptions{};
  return livenessFaceVerifyWithOptions(request, runtime);
}

model Mobile3MetaDetailStandardVerifyRequest {
  identifyNum?: string(name='IdentifyNum', example='429001********8211'),
  mobile?: string(name='Mobile', example='138********'),
  paramType?: string(name='ParamType', example='normal'),
  userName?: string(name='UserName'),
}

model Mobile3MetaDetailStandardVerifyResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', description='Id of the request', example='8FC3D6AC-9FED-4311-8DA7-C4BF47D9F260'),
  resultObject?: {
    bizCode?: string(name='BizCode', example='1'),
    ispName?: string(name='IspName', example='CMCC'),
    subCode?: string(name='SubCode', example='101'),
  }(name='ResultObject'),
}

model Mobile3MetaDetailStandardVerifyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: Mobile3MetaDetailStandardVerifyResponseBody(name='body'),
}

/**
 * @summary 手机号三要素详版_标准版
 *
 * @param request Mobile3MetaDetailStandardVerifyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return Mobile3MetaDetailStandardVerifyResponse
 */
async function mobile3MetaDetailStandardVerifyWithOptions(request: Mobile3MetaDetailStandardVerifyRequest, runtime: $RuntimeOptions): Mobile3MetaDetailStandardVerifyResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.identifyNum)) {
    body['IdentifyNum'] = request.identifyNum;
  }
  if (!$isNull(request.mobile)) {
    body['Mobile'] = request.mobile;
  }
  if (!$isNull(request.paramType)) {
    body['ParamType'] = request.paramType;
  }
  if (!$isNull(request.userName)) {
    body['UserName'] = request.userName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'Mobile3MetaDetailStandardVerify',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 手机号三要素详版_标准版
 *
 * @param request Mobile3MetaDetailStandardVerifyRequest
 * @return Mobile3MetaDetailStandardVerifyResponse
 */
async function mobile3MetaDetailStandardVerify(request: Mobile3MetaDetailStandardVerifyRequest): Mobile3MetaDetailStandardVerifyResponse {
  var runtime = new $RuntimeOptions{};
  return mobile3MetaDetailStandardVerifyWithOptions(request, runtime);
}

model Mobile3MetaDetailVerifyRequest {
  identifyNum?: string(name='IdentifyNum'),
  mobile?: string(name='Mobile'),
  paramType?: string(name='ParamType'),
  userName?: string(name='UserName'),
}

model Mobile3MetaDetailVerifyResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='5A6229C0-E156-48E4-B6EC-0F528BDF60D2'),
  resultObject?: {
    bizCode?: string(name='BizCode', example='1'),
    ispName?: string(name='IspName', example='CMCC'),
    subCode?: string(name='SubCode', example='101'),
  }(name='ResultObject'),
}

model Mobile3MetaDetailVerifyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: Mobile3MetaDetailVerifyResponseBody(name='body'),
}

/**
 * @summary 手机三要素详版接口
 *
 * @param request Mobile3MetaDetailVerifyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return Mobile3MetaDetailVerifyResponse
 */
async function mobile3MetaDetailVerifyWithOptions(request: Mobile3MetaDetailVerifyRequest, runtime: $RuntimeOptions): Mobile3MetaDetailVerifyResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.identifyNum)) {
    body['IdentifyNum'] = request.identifyNum;
  }
  if (!$isNull(request.mobile)) {
    body['Mobile'] = request.mobile;
  }
  if (!$isNull(request.paramType)) {
    body['ParamType'] = request.paramType;
  }
  if (!$isNull(request.userName)) {
    body['UserName'] = request.userName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'Mobile3MetaDetailVerify',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 手机三要素详版接口
 *
 * @param request Mobile3MetaDetailVerifyRequest
 * @return Mobile3MetaDetailVerifyResponse
 */
async function mobile3MetaDetailVerify(request: Mobile3MetaDetailVerifyRequest): Mobile3MetaDetailVerifyResponse {
  var runtime = new $RuntimeOptions{};
  return mobile3MetaDetailVerifyWithOptions(request, runtime);
}

model Mobile3MetaSimpleStandardVerifyRequest {
  identifyNum?: string(name='IdentifyNum', example='429001********8211'),
  mobile?: string(name='Mobile', example='130********'),
  paramType?: string(name='ParamType', example='normal'),
  userName?: string(name='UserName'),
}

model Mobile3MetaSimpleStandardVerifyResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', description='Id of the request', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  resultObject?: {
    bizCode?: string(name='BizCode', example='1'),
    ispName?: string(name='IspName', example='CMCC'),
  }(name='ResultObject'),
}

model Mobile3MetaSimpleStandardVerifyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: Mobile3MetaSimpleStandardVerifyResponseBody(name='body'),
}

/**
 * @summary 手机号三要素简版_标准版
 *
 * @param request Mobile3MetaSimpleStandardVerifyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return Mobile3MetaSimpleStandardVerifyResponse
 */
async function mobile3MetaSimpleStandardVerifyWithOptions(request: Mobile3MetaSimpleStandardVerifyRequest, runtime: $RuntimeOptions): Mobile3MetaSimpleStandardVerifyResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.identifyNum)) {
    body['IdentifyNum'] = request.identifyNum;
  }
  if (!$isNull(request.mobile)) {
    body['Mobile'] = request.mobile;
  }
  if (!$isNull(request.paramType)) {
    body['ParamType'] = request.paramType;
  }
  if (!$isNull(request.userName)) {
    body['UserName'] = request.userName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'Mobile3MetaSimpleStandardVerify',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 手机号三要素简版_标准版
 *
 * @param request Mobile3MetaSimpleStandardVerifyRequest
 * @return Mobile3MetaSimpleStandardVerifyResponse
 */
async function mobile3MetaSimpleStandardVerify(request: Mobile3MetaSimpleStandardVerifyRequest): Mobile3MetaSimpleStandardVerifyResponse {
  var runtime = new $RuntimeOptions{};
  return mobile3MetaSimpleStandardVerifyWithOptions(request, runtime);
}

model Mobile3MetaSimpleVerifyRequest {
  identifyNum?: string(name='IdentifyNum'),
  mobile?: string(name='Mobile'),
  paramType?: string(name='ParamType'),
  userName?: string(name='UserName'),
}

model Mobile3MetaSimpleVerifyResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  resultObject?: {
    bizCode?: string(name='BizCode', example='1'),
    ispName?: string(name='IspName', example='CMCC'),
  }(name='ResultObject'),
}

model Mobile3MetaSimpleVerifyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: Mobile3MetaSimpleVerifyResponseBody(name='body'),
}

/**
 * @summary 手机号三要素简版接口
 *
 * @param request Mobile3MetaSimpleVerifyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return Mobile3MetaSimpleVerifyResponse
 */
async function mobile3MetaSimpleVerifyWithOptions(request: Mobile3MetaSimpleVerifyRequest, runtime: $RuntimeOptions): Mobile3MetaSimpleVerifyResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.identifyNum)) {
    body['IdentifyNum'] = request.identifyNum;
  }
  if (!$isNull(request.mobile)) {
    body['Mobile'] = request.mobile;
  }
  if (!$isNull(request.paramType)) {
    body['ParamType'] = request.paramType;
  }
  if (!$isNull(request.userName)) {
    body['UserName'] = request.userName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'Mobile3MetaSimpleVerify',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 手机号三要素简版接口
 *
 * @param request Mobile3MetaSimpleVerifyRequest
 * @return Mobile3MetaSimpleVerifyResponse
 */
async function mobile3MetaSimpleVerify(request: Mobile3MetaSimpleVerifyRequest): Mobile3MetaSimpleVerifyResponse {
  var runtime = new $RuntimeOptions{};
  return mobile3MetaSimpleVerifyWithOptions(request, runtime);
}

model MobileDetectRequest {
  mobiles?: string(name='Mobiles'),
  paramType?: string(name='ParamType'),
}

model MobileDetectResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='969434DF-926B-4997-9881-4DE94E39F805'),
  resultObject?: {
    chargeCount?: string(name='ChargeCount', example='2'),
    items?: [ 
      {
        area?: string(name='Area'),
        bizCode?: string(name='BizCode', example='1'),
        ispName?: string(name='IspName', example='CMCC'),
        mobile?: string(name='Mobile', example='131********'),
        subCode?: string(name='SubCode', example='101'),
      }
    ](name='Items'),
  }(name='ResultObject'),
}

model MobileDetectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MobileDetectResponseBody(name='body'),
}

/**
 * @summary 号码检测
 *
 * @param request MobileDetectRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return MobileDetectResponse
 */
async function mobileDetectWithOptions(request: MobileDetectRequest, runtime: $RuntimeOptions): MobileDetectResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.mobiles)) {
    body['Mobiles'] = request.mobiles;
  }
  if (!$isNull(request.paramType)) {
    body['ParamType'] = request.paramType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'MobileDetect',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 号码检测
 *
 * @param request MobileDetectRequest
 * @return MobileDetectResponse
 */
async function mobileDetect(request: MobileDetectRequest): MobileDetectResponse {
  var runtime = new $RuntimeOptions{};
  return mobileDetectWithOptions(request, runtime);
}

model MobileOnlineStatusRequest {
  mobile?: string(name='Mobile'),
  paramType?: string(name='ParamType'),
}

model MobileOnlineStatusResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='B506328A-D84B-4750-82C7-6A207C585CF1'),
  resultObject?: {
    bizCode?: string(name='BizCode', example='1'),
    ispName?: string(name='IspName', example='CMCC'),
    subCode?: string(name='SubCode', example='101'),
  }(name='ResultObject'),
}

model MobileOnlineStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MobileOnlineStatusResponseBody(name='body'),
}

/**
 * @summary 查询手机号在网状态
 *
 * @param request MobileOnlineStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return MobileOnlineStatusResponse
 */
async function mobileOnlineStatusWithOptions(request: MobileOnlineStatusRequest, runtime: $RuntimeOptions): MobileOnlineStatusResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.mobile)) {
    body['Mobile'] = request.mobile;
  }
  if (!$isNull(request.paramType)) {
    body['ParamType'] = request.paramType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'MobileOnlineStatus',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询手机号在网状态
 *
 * @param request MobileOnlineStatusRequest
 * @return MobileOnlineStatusResponse
 */
async function mobileOnlineStatus(request: MobileOnlineStatusRequest): MobileOnlineStatusResponse {
  var runtime = new $RuntimeOptions{};
  return mobileOnlineStatusWithOptions(request, runtime);
}

model MobileOnlineTimeRequest {
  mobile?: string(name='Mobile'),
  paramType?: string(name='ParamType'),
}

model MobileOnlineTimeResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='B506328A-D84B-4750-82C7-6A207C585CF1'),
  resultObject?: {
    bizCode?: string(name='BizCode', example='1'),
    ispName?: string(name='IspName', example='CMCC'),
    timeCode?: string(name='TimeCode', example='5'),
  }(name='ResultObject'),
}

model MobileOnlineTimeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: MobileOnlineTimeResponseBody(name='body'),
}

/**
 * @summary 查询手机号在网时长
 *
 * @param request MobileOnlineTimeRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return MobileOnlineTimeResponse
 */
async function mobileOnlineTimeWithOptions(request: MobileOnlineTimeRequest, runtime: $RuntimeOptions): MobileOnlineTimeResponse {
  request.validate();
  var body : map[string]any = {};
  if (!$isNull(request.mobile)) {
    body['Mobile'] = request.mobile;
  }
  if (!$isNull(request.paramType)) {
    body['ParamType'] = request.paramType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApiUtil.Params{
    action = 'MobileOnlineTime',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询手机号在网时长
 *
 * @param request MobileOnlineTimeRequest
 * @return MobileOnlineTimeResponse
 */
async function mobileOnlineTime(request: MobileOnlineTimeRequest): MobileOnlineTimeResponse {
  var runtime = new $RuntimeOptions{};
  return mobileOnlineTimeWithOptions(request, runtime);
}

model ModifyDeviceInfoRequest {
  bizType?: string(name='BizType', example='FACE_TEST'),
  deviceId?: string(name='DeviceId', description='This parameter is required.', example='wd.6ziUffspAeW5FVYbaqmexR-1qwNjM'),
  duration?: string(name='Duration', example='1'),
  expiredDay?: string(name='ExpiredDay', example='20190401'),
  userDeviceId?: string(name='UserDeviceId', example='3iJ1AY$oHcu7mC69'),
}

model ModifyDeviceInfoResponseBody = {
  beginDay?: string(name='BeginDay', example='20190401'),
  bizType?: string(name='BizType', example='FACE_TEST'),
  deviceId?: string(name='DeviceId', example='wd.6ziUffspAeW5FVYbaqmexR-1qwNjM'),
  expiredDay?: string(name='ExpiredDay', example='20200330'),
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  userDeviceId?: string(name='UserDeviceId', example='3iJ1AY$oHcu7mC69'),
}

model ModifyDeviceInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyDeviceInfoResponseBody(name='body'),
}

/**
 * @param request ModifyDeviceInfoRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyDeviceInfoResponse
 */
async function modifyDeviceInfoWithOptions(request: ModifyDeviceInfoRequest, runtime: $RuntimeOptions): ModifyDeviceInfoResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.bizType)) {
    query['BizType'] = request.bizType;
  }
  if (!$isNull(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!$isNull(request.duration)) {
    query['Duration'] = request.duration;
  }
  if (!$isNull(request.expiredDay)) {
    query['ExpiredDay'] = request.expiredDay;
  }
  if (!$isNull(request.userDeviceId)) {
    query['UserDeviceId'] = request.userDeviceId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ModifyDeviceInfo',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ModifyDeviceInfoRequest
 * @return ModifyDeviceInfoResponse
 */
async function modifyDeviceInfo(request: ModifyDeviceInfoRequest): ModifyDeviceInfoResponse {
  var runtime = new $RuntimeOptions{};
  return modifyDeviceInfoWithOptions(request, runtime);
}

model PageQueryWhiteListSettingRequest {
  certNo?: string(name='CertNo', example='330103xxxxxxxxxxxx'),
  certifyId?: string(name='CertifyId', example='sha75b4e19a1ddda059b920757b0e12b'),
  currentPage?: int32(name='CurrentPage', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  sceneId?: long(name='SceneId', example='1000000xxx'),
  serviceCode?: string(name='ServiceCode', example='antcloudauth'),
  status?: string(name='Status', example='VALID'),
  validEndDate?: string(name='ValidEndDate', example='1725379200000'),
  validStartDate?: string(name='ValidStartDate', example='1725120000000'),
}

model PageQueryWhiteListSettingResponseBody = {
  code?: string(name='Code', example='200'),
  currentPage?: int32(name='CurrentPage', example='1'),
  message?: string(name='Message', example='success'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', description='Id of the request', example='5A6229C0-E156-48E4-B6EC-0F528BDF60D2'),
  resultObject?: [ 
    {
      certNo?: string(name='CertNo', example='330103xxxxxxxxxxxx'),
      certifyId?: string(name='CertifyId', example='sha43d9cabd52d370d9f4cca9468f71e'),
      gmtCreate?: string(name='GmtCreate', example='2024-08-30 14:00:00'),
      gmtModified?: string(name='GmtModified', example='2024-08-30 14:00:00'),
      id?: long(name='Id', example='234822'),
      remark?: string(name='Remark', example='test'),
      sceneId?: long(name='SceneId', example='1000000332'),
      serviceCode?: string(name='ServiceCode', example='antcloudauth'),
      status?: string(name='Status', example='VALID'),
      validEndDate?: string(name='ValidEndDate', example='2024-09-02 13:57:51'),
      validStartDate?: string(name='ValidStartDate', example='2024-08-30 13:57:51'),
    }
  ](name='ResultObject'),
  success?: boolean(name='Success', example='true'),
  totalItem?: int32(name='TotalItem', example='28'),
  totalPage?: int32(name='TotalPage', example='3'),
}

model PageQueryWhiteListSettingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PageQueryWhiteListSettingResponseBody(name='body'),
}

/**
 * @summary 分页查询实人白名单配置
 *
 * @param request PageQueryWhiteListSettingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return PageQueryWhiteListSettingResponse
 */
async function pageQueryWhiteListSettingWithOptions(request: PageQueryWhiteListSettingRequest, runtime: $RuntimeOptions): PageQueryWhiteListSettingResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.certNo)) {
    query['CertNo'] = request.certNo;
  }
  if (!$isNull(request.certifyId)) {
    query['CertifyId'] = request.certifyId;
  }
  if (!$isNull(request.currentPage)) {
    query['CurrentPage'] = request.currentPage;
  }
  if (!$isNull(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!$isNull(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  if (!$isNull(request.serviceCode)) {
    query['ServiceCode'] = request.serviceCode;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  if (!$isNull(request.validEndDate)) {
    query['ValidEndDate'] = request.validEndDate;
  }
  if (!$isNull(request.validStartDate)) {
    query['ValidStartDate'] = request.validStartDate;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'PageQueryWhiteListSetting',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 分页查询实人白名单配置
 *
 * @param request PageQueryWhiteListSettingRequest
 * @return PageQueryWhiteListSettingResponse
 */
async function pageQueryWhiteListSetting(request: PageQueryWhiteListSettingRequest): PageQueryWhiteListSettingResponse {
  var runtime = new $RuntimeOptions{};
  return pageQueryWhiteListSettingWithOptions(request, runtime);
}

model RemoveWhiteListSettingRequest {
  ids?: [ long ](name='Ids'),
  serviceCode?: string(name='ServiceCode', example='antcloudauth'),
}

model RemoveWhiteListSettingShrinkRequest {
  idsShrink?: string(name='Ids'),
  serviceCode?: string(name='ServiceCode', example='antcloudauth'),
}

model RemoveWhiteListSettingResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', description='Id of the request', example='473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E'),
  resultObject?: boolean(name='ResultObject', example='true'),
  success?: boolean(name='Success', example='true'),
}

model RemoveWhiteListSettingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveWhiteListSettingResponseBody(name='body'),
}

/**
 * @summary 删除实人白名单
 *
 * @param tmpReq RemoveWhiteListSettingRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveWhiteListSettingResponse
 */
async function removeWhiteListSettingWithOptions(tmpReq: RemoveWhiteListSettingRequest, runtime: $RuntimeOptions): RemoveWhiteListSettingResponse {
  tmpReq.validate();
  var request = new RemoveWhiteListSettingShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!$isNull(tmpReq.ids)) {
    request.idsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.ids, 'Ids', 'json');
  }
  var query = {};
  if (!$isNull(request.idsShrink)) {
    query['Ids'] = request.idsShrink;
  }
  if (!$isNull(request.serviceCode)) {
    query['ServiceCode'] = request.serviceCode;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'RemoveWhiteListSetting',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除实人白名单
 *
 * @param request RemoveWhiteListSettingRequest
 * @return RemoveWhiteListSettingResponse
 */
async function removeWhiteListSetting(request: RemoveWhiteListSettingRequest): RemoveWhiteListSettingResponse {
  var runtime = new $RuntimeOptions{};
  return removeWhiteListSettingWithOptions(request, runtime);
}

model Vehicle5ItemQueryRequest {
  paramType?: string(name='ParamType', example='normal'),
  vehicleNum?: string(name='VehicleNum'),
  vehicleType?: string(name='VehicleType', example='02'),
}

model Vehicle5ItemQueryResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='473469C7-AA6F-4DC5-B3DB-A3DC0D******'),
  resultObject?: {
    bizCode?: string(name='BizCode', example='1'),
    vehicleInfo?: string(name='VehicleInfo'),
  }(name='ResultObject'),
}

model Vehicle5ItemQueryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: Vehicle5ItemQueryResponseBody(name='body'),
}

/**
 * @summary 车五项信息识别
 *
 * @param request Vehicle5ItemQueryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return Vehicle5ItemQueryResponse
 */
async function vehicle5ItemQueryWithOptions(request: Vehicle5ItemQueryRequest, runtime: $RuntimeOptions): Vehicle5ItemQueryResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.paramType)) {
    query['ParamType'] = request.paramType;
  }
  if (!$isNull(request.vehicleNum)) {
    query['VehicleNum'] = request.vehicleNum;
  }
  if (!$isNull(request.vehicleType)) {
    query['VehicleType'] = request.vehicleType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'Vehicle5ItemQuery',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 车五项信息识别
 *
 * @param request Vehicle5ItemQueryRequest
 * @return Vehicle5ItemQueryResponse
 */
async function vehicle5ItemQuery(request: Vehicle5ItemQueryRequest): Vehicle5ItemQueryResponse {
  var runtime = new $RuntimeOptions{};
  return vehicle5ItemQueryWithOptions(request, runtime);
}

model VehicleInsureQueryRequest {
  paramType?: string(name='ParamType', example='normal'),
  vehicleNum?: string(name='VehicleNum'),
  vehicleType?: string(name='VehicleType', example='02'),
  vin?: string(name='Vin', example='LB**************'),
}

model VehicleInsureQueryResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='5A6229C0-E156-48E4-B6EC-0F52********'),
  resultObject?: {
    bizCode?: string(name='BizCode', example='1'),
    vehicleInfo?: string(name='VehicleInfo', example='{
    "firstInsuranceDate": "****-**-**",
    "lastInsuranceDate": "****-**",
    "latestInsuranceDate": "****-**",
    "latestInsuranceDateStart": "****-**"
  }'),
  }(name='ResultObject'),
}

model VehicleInsureQueryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: VehicleInsureQueryResponseBody(name='body'),
}

/**
 * @summary 车辆投保日期查询
 *
 * @param request VehicleInsureQueryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return VehicleInsureQueryResponse
 */
async function vehicleInsureQueryWithOptions(request: VehicleInsureQueryRequest, runtime: $RuntimeOptions): VehicleInsureQueryResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.paramType)) {
    query['ParamType'] = request.paramType;
  }
  if (!$isNull(request.vehicleNum)) {
    query['VehicleNum'] = request.vehicleNum;
  }
  if (!$isNull(request.vehicleType)) {
    query['VehicleType'] = request.vehicleType;
  }
  if (!$isNull(request.vin)) {
    query['Vin'] = request.vin;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'VehicleInsureQuery',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 车辆投保日期查询
 *
 * @param request VehicleInsureQueryRequest
 * @return VehicleInsureQueryResponse
 */
async function vehicleInsureQuery(request: VehicleInsureQueryRequest): VehicleInsureQueryResponse {
  var runtime = new $RuntimeOptions{};
  return vehicleInsureQueryWithOptions(request, runtime);
}

model VehicleMetaVerifyRequest {
  identifyNum?: string(name='IdentifyNum', example='4****************1'),
  paramType?: string(name='ParamType', example='normal'),
  userName?: string(name='UserName'),
  vehicleNum?: string(name='VehicleNum'),
  vehicleType?: string(name='VehicleType', example='02'),
  verifyMetaType?: string(name='VerifyMetaType', example='VEHICLE_2_META'),
}

model VehicleMetaVerifyResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', description='Id of the request', example='8FC3D6AC-9FED-4311-8DA7-C4BF4*****'),
  resultObject?: {
    bizCode?: string(name='BizCode', example='1'),
  }(name='ResultObject'),
}

model VehicleMetaVerifyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: VehicleMetaVerifyResponseBody(name='body'),
}

/**
 * @summary 车辆要素核验
 *
 * @param request VehicleMetaVerifyRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return VehicleMetaVerifyResponse
 */
async function vehicleMetaVerifyWithOptions(request: VehicleMetaVerifyRequest, runtime: $RuntimeOptions): VehicleMetaVerifyResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.identifyNum)) {
    query['IdentifyNum'] = request.identifyNum;
  }
  if (!$isNull(request.paramType)) {
    query['ParamType'] = request.paramType;
  }
  if (!$isNull(request.userName)) {
    query['UserName'] = request.userName;
  }
  if (!$isNull(request.vehicleNum)) {
    query['VehicleNum'] = request.vehicleNum;
  }
  if (!$isNull(request.vehicleType)) {
    query['VehicleType'] = request.vehicleType;
  }
  if (!$isNull(request.verifyMetaType)) {
    query['VerifyMetaType'] = request.verifyMetaType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'VehicleMetaVerify',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 车辆要素核验
 *
 * @param request VehicleMetaVerifyRequest
 * @return VehicleMetaVerifyResponse
 */
async function vehicleMetaVerify(request: VehicleMetaVerifyRequest): VehicleMetaVerifyResponse {
  var runtime = new $RuntimeOptions{};
  return vehicleMetaVerifyWithOptions(request, runtime);
}

model VehicleMetaVerifyV2Request {
  identifyNum?: string(name='IdentifyNum', example='4****************1'),
  paramType?: string(name='ParamType', example='normal'),
  userName?: string(name='UserName'),
  vehicleNum?: string(name='VehicleNum'),
  vehicleType?: string(name='VehicleType', example='02'),
  verifyMetaType?: string(name='VerifyMetaType', example='VEHICLE_3_META'),
}

model VehicleMetaVerifyV2ResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='5A6229C0-E156-48E4-B6EC-0F528B******'),
  resultObject?: {
    bizCode?: string(name='BizCode', example='1'),
    vehicleInfo?: string(name='VehicleInfo'),
  }(name='ResultObject'),
}

model VehicleMetaVerifyV2Response = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: VehicleMetaVerifyV2ResponseBody(name='body'),
}

/**
 * @summary 车辆要素核验增强版
 *
 * @param request VehicleMetaVerifyV2Request
 * @param runtime runtime options for this request RuntimeOptions
 * @return VehicleMetaVerifyV2Response
 */
async function vehicleMetaVerifyV2WithOptions(request: VehicleMetaVerifyV2Request, runtime: $RuntimeOptions): VehicleMetaVerifyV2Response {
  request.validate();
  var query = {};
  if (!$isNull(request.identifyNum)) {
    query['IdentifyNum'] = request.identifyNum;
  }
  if (!$isNull(request.paramType)) {
    query['ParamType'] = request.paramType;
  }
  if (!$isNull(request.userName)) {
    query['UserName'] = request.userName;
  }
  if (!$isNull(request.vehicleNum)) {
    query['VehicleNum'] = request.vehicleNum;
  }
  if (!$isNull(request.vehicleType)) {
    query['VehicleType'] = request.vehicleType;
  }
  if (!$isNull(request.verifyMetaType)) {
    query['VerifyMetaType'] = request.verifyMetaType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'VehicleMetaVerifyV2',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 车辆要素核验增强版
 *
 * @param request VehicleMetaVerifyV2Request
 * @return VehicleMetaVerifyV2Response
 */
async function vehicleMetaVerifyV2(request: VehicleMetaVerifyV2Request): VehicleMetaVerifyV2Response {
  var runtime = new $RuntimeOptions{};
  return vehicleMetaVerifyV2WithOptions(request, runtime);
}

model VehicleQueryRequest {
  paramType?: string(name='ParamType', example='normal'),
  vehicleNum?: string(name='VehicleNum'),
  vehicleType?: string(name='VehicleType', example='02'),
}

model VehicleQueryResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='D6163397-15C5-419C-9ACC-B7C83*******'),
  resultObject?: {
    bizCode?: string(name='BizCode', example='1'),
    vehicleInfo?: string(name='VehicleInfo'),
  }(name='ResultObject'),
}

model VehicleQueryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: VehicleQueryResponseBody(name='body'),
}

/**
 * @summary 车辆信息识别
 *
 * @param request VehicleQueryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return VehicleQueryResponse
 */
async function vehicleQueryWithOptions(request: VehicleQueryRequest, runtime: $RuntimeOptions): VehicleQueryResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.paramType)) {
    query['ParamType'] = request.paramType;
  }
  if (!$isNull(request.vehicleNum)) {
    query['VehicleNum'] = request.vehicleNum;
  }
  if (!$isNull(request.vehicleType)) {
    query['VehicleType'] = request.vehicleType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'VehicleQuery',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 车辆信息识别
 *
 * @param request VehicleQueryRequest
 * @return VehicleQueryResponse
 */
async function vehicleQuery(request: VehicleQueryRequest): VehicleQueryResponse {
  var runtime = new $RuntimeOptions{};
  return vehicleQueryWithOptions(request, runtime);
}

model VerifyMaterialRequest {
  bizId?: string(name='BizId', description='This parameter is required.', example='39ecf51e-2f81-4dc5-90ee-ff86125b****'),
  bizType?: string(name='BizType', description='This parameter is required.', example='RPMinTest'),
  faceImageUrl?: string(name='FaceImageUrl', description='This parameter is required.', example='http://image-demo.img-cn-hangzhou.aliyuncs.com/example.jpg'),
  idCardBackImageUrl?: string(name='IdCardBackImageUrl', example='http://image-demo.img-cn-hangzhou.aliyuncs.com/example3.jpg'),
  idCardFrontImageUrl?: string(name='IdCardFrontImageUrl', example='http://image-demo.img-cn-hangzhou.aliyuncs.com/example2.jpg'),
  idCardNumber?: string(name='IdCardNumber', description='This parameter is required.', example='02343218901123****'),
  name?: string(name='Name', description='This parameter is required.'),
  userId?: string(name='UserId', example='54sdj'),
}

model VerifyMaterialResponseBody = {
  authorityComparisionScore?: float(name='AuthorityComparisionScore', example='97'),
  idCardFaceComparisonScore?: float(name='IdCardFaceComparisonScore', example='97'),
  material?: {
    faceGlobalUrl?: string(name='FaceGlobalUrl', example='http://image-demo.img-cn-hangzhou.aliyuncs.com/face-global-example.jpg'),
    faceImageUrl?: string(name='FaceImageUrl', example='http://image-demo.img-cn-hangzhou.aliyuncs.com/example.jpg'),
    faceMask?: string(name='FaceMask', example='false'),
    faceQuality?: string(name='FaceQuality', example='NORMAL'),
    idCardInfo?: {
      address?: string(name='Address'),
      authority?: string(name='Authority'),
      backImageUrl?: string(name='BackImageUrl', example='http://image-demo.img-cn-hangzhou.aliyuncs.com/example3.jpg'),
      birth?: string(name='Birth', example='19900101'),
      endDate?: string(name='EndDate', example='20201101'),
      frontImageUrl?: string(name='FrontImageUrl', example='http://image-demo.img-cn-hangzhou.aliyuncs.com/example2.jpg'),
      name?: string(name='Name'),
      nationality?: string(name='Nationality'),
      number?: string(name='Number', example='02343218901123****'),
      startDate?: string(name='StartDate', example='20201101'),
    }(name='IdCardInfo'),
    idCardName?: string(name='IdCardName'),
    idCardNumber?: string(name='IdCardNumber', example='02343218901123****'),
  }(name='Material'),
  requestId?: string(name='RequestId', example='04F0F334-1335-436C-A1D7-6C044FE73368'),
  verifyStatus?: int32(name='VerifyStatus', example='1'),
  verifyToken?: string(name='VerifyToken', example='c302c0797679457685410ee51a5ba375'),
}

model VerifyMaterialResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: VerifyMaterialResponseBody(name='body'),
}

/**
 * @param request VerifyMaterialRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return VerifyMaterialResponse
 */
async function verifyMaterialWithOptions(request: VerifyMaterialRequest, runtime: $RuntimeOptions): VerifyMaterialResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!$isNull(request.bizType)) {
    query['BizType'] = request.bizType;
  }
  if (!$isNull(request.faceImageUrl)) {
    query['FaceImageUrl'] = request.faceImageUrl;
  }
  if (!$isNull(request.idCardBackImageUrl)) {
    query['IdCardBackImageUrl'] = request.idCardBackImageUrl;
  }
  if (!$isNull(request.idCardFrontImageUrl)) {
    query['IdCardFrontImageUrl'] = request.idCardFrontImageUrl;
  }
  if (!$isNull(request.idCardNumber)) {
    query['IdCardNumber'] = request.idCardNumber;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'VerifyMaterial',
    version = '2019-03-07',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request VerifyMaterialRequest
 * @return VerifyMaterialResponse
 */
async function verifyMaterial(request: VerifyMaterialRequest): VerifyMaterialResponse {
  var runtime = new $RuntimeOptions{};
  return verifyMaterialWithOptions(request, runtime);
}

